HTML and CSS Reference
In-Depth Information
Using other libraries
If you are more comfortable using other libraries, you can also load and use them in
a similar way to jQuery.
The following is how we load jQuery:
<script src="//ajax.googleapis.com/ajax/libs/
jquery/1.8.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script
src="js/vendor/jquery-1.8.2.min.js"><\/script>')
</script>
Let us say, you want to use another library (like MooTools), then look up the Google
Libraries API to see if that library is available at developers.google.com/speed/
libraries/ . If it is available, just replace the reference with the appropriate refer-
ence from the site. For example, if we want to replace our jQuery link with a link to
MooTools, we would simply replace the following code:
<script src="//ajax.googleapis.com/ajax/libs/
jquery/1.7.2/jquery.min.js">
</script>
With the following line of code:
<script src="ajax.googleapis.com/ajax/libs/
mootools/1.4.5/mootools-yui-compressed.js">
</script>
We will also download Mootools' minified file to the js/vendor folder locally and re-
place the following code:
<script>window.jQuery||document.write('<script
src="js/vendor/jquery-1.7.2.min.js"><\/script>')
</script>
Search WWH ::




Custom Search