

Using Firebug, it's possible to measure the time each of the two functions takes to run. Whenever you're looping through an object received as JSON, you'd better rewrite your JSON and make it return an array through which you can loop easier.

Native functions are always faster than any helper counterparts. From YUI compressor, an excellent tool jQuery officially reccomends to minify scripts.
#MINIFY JQUERY CODE#
The goal of JavaScript and CSS minification is always to preserve the operational qualities of the code while reducing its overall byte footprint (both in raw terms and after gzipping, as most JavaScript and CSS served from production web servers is gzipped as part of the HTTP protocol). Smaller file sizes equal faster load times. The majority of browsers are not able to process more than one script concurrently so they queue them up - and load times increase.Īssuming the scripts are to be loaded on every page of your website, you should consider putting them all into a single file and use a compression tool (such as Dean Edwards') to minify them. Rather than hard-coding the specific version of jQuery directly (1.3.2), you should instead use 1, which will automatically reference the most recent version of the library. * Editor's Note: Perhaps, the quicker and easier method is to simply link to the script directly. * and load minified jQuery v1.3.2 this way */

Google provides a lot of Ajax libraries from which to choose. If you want to stay up to date without having to download the library a thousand times, GIYF (Google Is Your Friend), in this situation too. John and his team are always researching new ways to improve program performances.Īs a sidenote, just a few months ago, he released Sizzle, a selector library that's said to improve program performances up to 3 times in Firefox. JQuery is in constant development and improvement.
