-
Book Overview & Buying
-
Table Of Contents
jQuery 1.3 with PHP
By :
There are many libraries and frameworks available for JavaScript, including MooTools, Ext, Dojo, and Prototype. So, why use jQuery and not others? Here are some of the reasons:
jQuery has a huge number of plugins available for everything you could imagine wanting to do online
The information on the jQuery site is extremely well documented, with many examples
jQuery does not extend the elements that it works on, which means that JavaScript such as 'for(i in el){...}' will still work
jQuery's CSS selector engine, Sizzle, is arguably the most complete and the quickest available
jQuery is available at Google's Ajax Libs CDN (http://code.google.com/apis/ajaxlibs), so probably you already have it in your browser's cache.
There are benefits and detractors to everything. So in the end, it's a matter of taste.
In my case, I was using MooTools before I turned to jQuery, but MooTools' habit of extending every element it touches was interfering with my own code, so I had to replace it.
I chose jQuery because the body of knowledge on it was very large (every second article on JavaScript blogs appears to mention jQuery), it's impressively clean to work with, and there are a massive number of plugins available.
Also, because jQuery is used in so many large projects (a few of which are mentioned in the Projects that use PHP and jQuery section of this chapter). If you have ever worked on any of those projects, you will find that the skills you learned on them are transferable to other projects using jQuery.
Change the font size
Change margin width
Change background colour