Checking whether jQuery and jQuery ui have loaded

Basic stuff for those who know what they’re doing with js – useful to me, when intranets keep stripping URLs and things!

<script type="text/javascript"><!--
window.onload = function() {
 if (window.jQuery) { 
 // jQuery is loaded 
 alert("jQuery loaded -Yeah!");
 } else {
 // jQuery is not loaded
 alert("jQuery Doesn't Work");
 }

if (jQuery.ui) {
 // UI loaded
alert("jQuery ui loaded too");
} else {
alert("jQuery ui not loaded");
}
}
// --></script>
Tech Reference:

Leave a Reply

Your email address will not be published. Required fields are marked *

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑