Skip to content

Instantly share code, notes, and snippets.

@kevinkirkup
Created March 13, 2012 14:16
Show Gist options
  • Save kevinkirkup/2029043 to your computer and use it in GitHub Desktop.
Save kevinkirkup/2029043 to your computer and use it in GitHub Desktop.
jQuery Async Script loading
//
// Dynamically generate the html script tag to prevent
// blocking the parser.
// http://css-tricks.com/thinking-async/
//
jQuery.ajax({
url: '//third-party.com/resource.js',
dataType: 'script',
success: function() {
// script loaded, do stuff!
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment