Possible Duplicate:
How to check if jQuery is loaded and what version?
What is the best way to check to see if JQuery is loaded?
Basically, the most reliable way to check if jQuery has been loaded is to check typeof jQuery — it will return "function" if jQuery was already loaded on the page, or "undefined" if jQuery hasn't been loaded yet.
Hence, we have used the $(document). ready() function before we can check if the plugin was loaded successfully or not. The typeof operator returns the data type of its operand in the form of a string. In this case, the operand is the jQuery $ operator itself.
To check the presence of an element, we can use the method – findElements. The method findElements returns a list of matching elements. Then, we have to use the method size to get the number of items in the list. If the size is 0, it means that this element is absent from the page.
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.
if (typeof jQuery === 'undefined') {
// jQuery is NOT available
} else {
// jQuery is available
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With