How to load Ajax Libraries from Google Code?
Written on December 19, 2008 at 3:23 am by
mkyong
Google code is hosted a lot Ajax libraries, it’s free load it from any server or website. Here are the list of Ajax libraries provided so far.
- jQuery
- jQuery UI
- Prototype
- script_aculo_us
- MooTools
- Dojo
- Yahoo! User Interface Library (YUI)
Why need to load Ajax library from Google Code?
Sometime a lot people asking about why should load Ajax library from Google code? Basically, there are two obvious benefits :
- Save bandwitdh – Google server is faster than your server , library load very fast from Google code.
- Cache – High chance Google Ajax library is cached if user had visited some websites which deliver from Google code. It will increase your website response time.
Example to load JQuery library from Google code.
<script src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("jquery", "1.2.6"); google.setOnLoadCallback(function() { //your code }); </script>
Alternatively, you can also include a direct link like this
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
Reference
This article was posted in JQuery category.
All Java Tutorials
- Java Core Technology - Java RegEx, Java XML, Java I/O, Java Misc
- J2EE Frameworks - Hibernate, Spring 2.5, Spring MVC, Struts 1.x, Struts 2.x
- Build Tools - Maven, Archiva
- Unit Test - jUnit, TestNG
- Client Scripts - jQuery
Great!!
Thanks you.