Skip to content

Instantly share code, notes, and snippets.

@amanaplan
Created November 15, 2013 13:11
Show Gist options
  • Save amanaplan/7484107 to your computer and use it in GitHub Desktop.
Save amanaplan/7484107 to your computer and use it in GitHub Desktop.
Loads jQuery UI to match jQuery version, if loaded.
if (typeof jQuery != 'undefined' && typeof jQuery.ui == 'undefined'){
jqver = jQuery().jquery;
parent = document.documentElement.childNodes[0];
scriptui = document.createElement('script');
scriptui.type = 'text/javascript';
scriptui.src = 'https://ajax.googleapis.com/ajax/libs/jqueryui/' + jqver + '/jquery-ui.js';
parent.appendChild(scriptui);
alert('Loading your matches...');
}
else {
if (typeof jQuery == 'undefined'){
alert('Could not load. Please load jQuery first.');
}
if (typeof jQuery.ui!== 'undefined'){
alert('jQuery UI already loaded.');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment