Check if jQuery UI is loaded ?

Posted on

Question: How to check if jQuery UI is loaded on web page ?

First make sure you put any code that calls it in $(document).ready(). At that point, everything should be loaded on the page.

One better way is to check by writing:


$.ui

Or by getting the version:


$.ui.version

OR you can also write following code:

if (typeof jQuery.ui !== 'undefined')

console.log("loaded");

else
console.log("not loaded");

If the above code writes “loaded” on console window, that means jQueryUI is loaded.

Leave a Reply

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