Search code examples
javascriptjquery-tools

Testing if jQueryTools has loaded


How can I test if jQueryTools library has been loaded like we can do in jQuery or jQueryUI?

As I use cdn to load the libraries, I have to be sure of are properly loaded. With jQuery I use this code (using jQuery() function):

if (jQuery) {
  // library loaded
}

So I load the library using:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="jquery.min.js"><\/script>')</script>

Anything similar with jQueryTools?


Solution

  • You can just check and see if one of the methods in that plugin exists like this example:

    if(!jQuery().overlay) {
         // plug-in is not installed
    }