I need to make an ajax request and then process some data returned from server. I'd like to make this request earlier then document is ready. But i will be able to process data only after document is ready. I've got an idea to make something like this:
$.when($(document).ready(),
$.ajax(/*some request*/)).done(function(){//processing data from the server});
How will it work? or is there any other options to get the result i want