3 ms·
swap the first two lines: $.getJSON(my_url, function(data) { $(document).ready(function(){ $('<p>').text(data.some_text).appendTo('#some_container)
by MBlume 16y ago
swap the first two lines:
$.getJSON(my_url, function(data) {
$(document).ready(function(){
$('<p>').text(data.some_text).appendTo('#some_container);
});
});
- photon_off 16y agoVery clever. This works because $(document).ready will execute immediately if the page is already loaded.