Clive Walkden

PHP, MySQL, HTML5, CSS3, jQuery code and ideas.

jQuery Posts

jQuery A Beginning

jQuery A Beginning

in jQuery
by
with 0 Comments

I've been using jQuery now for a few months and thought I'd share some observations.

First point is that the libraries are available for free on Google's server. This has some great benefits to your site including, Decreased latency and better caching.

Decreased Latency

When you request the script from Google, your location is given to Google and they can then serve you the file closest to your location. This means that if your site is in London, UK and you're in California, USA, Google will serve you the jQuery code from USA.

Better Caching

When someone visits your site for the first time they have to download your copy of jQuery, this is then cached for subsequent visits. The chances are that someone has already visited a site with Google's jQuery script so when requested the browser returns a 304 not modified. This means one less request and a quicker loading site.

Implementation

After reading the benefits I'm sure you're all asking "How do i set this up on my websites!" Well it's simple. Add the code below in your

tags of your website. Job Done!

comments powered by Disqus