Skip to content

Instantly share code, notes, and snippets.

@ginsterbusch
Last active August 29, 2015 14:04
Show Gist options
  • Save ginsterbusch/ba304b2517de0b49a6b2 to your computer and use it in GitHub Desktop.
Save ginsterbusch/ba304b2517de0b49a6b2 to your computer and use it in GitHub Desktop.
Example for loading external scripts using jQuery
if( typeof jQuery != 'undefined' ) {
jQuery.getScript( '//cdnjs.cloudflare.com/ajax/libs/history.js/1.8/bundled-uncompressed/html4+html5/jquery.history.js' ).done(function( script, textStatus ) {
console.info( 'successfully loaded History.js');
if( typeof History != 'undefined') {
console.log( 'ready to use History.js')
}
}).fail(function( jqxhr, settings, exception ) {
console.error('failed to load History.js')
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment