Skip to content

Instantly share code, notes, and snippets.

@niyazpk
Last active December 10, 2015 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niyazpk/4440745 to your computer and use it in GitHub Desktop.
Save niyazpk/4440745 to your computer and use it in GitHub Desktop.
// make an ajax call before DOM ready.
$.ajax({
url: '/myAwesomeService'
}).done(function(data){
// when the result arrives,
// wait till DOM ready
$(function(){
// and attach it to the DOM
$('body').append(data);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment