Created
November 15, 2013 13:11
-
-
Save amanaplan/7484107 to your computer and use it in GitHub Desktop.
Loads jQuery UI to match jQuery version, if loaded.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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