Check if jQuery UI is loaded ?

Posted on Updated 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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s