Q: The jQuery plugin I bought just doesn't work!
A: Your web page might be loading two versions of jQuery!
To determine if this is the case, open the html source of your web page, do a keyword search for the word "jquery", and cycle through all of the cases where the word "jquery" appears inside the code.
Scripts that look like this are "plugins", and are not what we're looking for.
Scripts that look like this represent the core jQuery library, and are exactly what we're looking for.
Each of the examples directly above represents an instance of the jQuery library. And in the above example, only one of the scripts should be used while the other two should be deleted.
But if you happen to find multiple instances of jQuery, how do you know which one to keep and which one's to delete?
Usually it's best to just use the latest jQuery version. For example, if the following two scripts are found on your page, the "1.9.1" version is the better choice.
However, your website or plugin may not be compatible with this particular version of jQuery. When this happens, you're left with the following choices:
- Choose not to use the plugin
- If the plugin is using an outdated version of jQuery, ask the plugin author if they can update the plugin
- If your website is only compatible with an outdated version of jQuery and you built the site yourself, update your code. Otherwise, if the site is a template that you've purchased, ask the author of the template to update it.
One last thing to keep in mind when working with jQuery plugins:
jQuery plugins "hook" into the core jQuery library, and because of this, the jQuery library always needs to be loaded before the jQuery plugin. Loading the jQuery library and jQuery plugin scripts in the wrong order will render the plugin dysfunctional.