× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Including JavaScript libraries

Jessamyn Smith
Jun 17, 2015
<p>It is very important that you only include any given JavaScript library once on your page. Many libraries depend on jQuery, and may mention different versions in the documentation. You need to find one version of jQuery that will work with all your other libraries. Most often, minor versions are fine, e.g. any 1.x.y will work for all libraries that require 1.w.z. You may run into issues between major versions, like 1.x.y and 2.w.z.</p> <p>If you are seeing mysterious errors with jQuery or jQuery plugins, it's a good idea to check if you are including jQuery more than once.</p> <p>Also, if you are initilizing libraries in a $document.ready(), it is best to have one $document.ready() on the page, and initialize all libraries there.</p>

Get New Tutorials Delivered to Your Inbox

New tutorials will be sent to your Inbox once a week.

comments powered by Disqus