User login

Recent comments

How to include jQuery to your website from Google

There are several benefits of including jQuery from Google's server than including it from your own website. The most important reason is that you will not need to frequently download updates from jQuery website and update your files. Google will take care of this. You only need to specify major version of jQuery. See the code below for more details.

Add this code in your head tag:
<script type="text/javascript" 
        src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
  // You may specify partial version numbers, such as "1" or "1.3",
  //  with the same result. Doing so will automatically load the 
  //  latest version matching that partial revision pattern 
  //  (e.g. 1.3 would load 1.3.2 today and 1 would load 1.4.1).
  google.load("jquery", "1");
 
  google.setOnLoadCallback(function() {
    // Place init code here instead of $(document).ready()
  });
</script>
Now your document has jQuery loaded. You can see it by visiting your website and viewing source. Dave Ward has something to say about performance.
Posted under:

Custom Services

If you are looking a Drupal theme or project developer, feel free to contact me.

Contact

Recent Free Themes

Recent Articles


more info