Seems to me that AJAX before document-ready could get complicated once you want to actually do something with the response. Normally one would do something like this:
$(document).ready(function(){
$.getJSON(my_url, function(data) {
$('<p>').text(data.some_text).appendTo('#some_container);
});
});
But if we call getJSON before document-ready, the node $('#some_container') may not yet exist! Now we need some way to wait until both the AJAX request is complete and the document is ready…recommendations?EDIT: Thanks for the responses, glad to know it's safer than I thought!