Book Image

jQuery 1.3 with PHP

Book Image

jQuery 1.3 with PHP

Overview of this book

To make PHP applications that respond quickly, avoid unnecessary page reloads, and provide great user interfaces, often requires complex JavaScript techniques and even then, if you get that far, they might not even work across different browsers! With jQuery, you can use one of the most popular JavaScript libraries, forget about cross-browser issues, and simplify the creation of very powerful and responsive interfaces ñ all with the minimum of code. This is the first book in the market that will ease the server-side PHP coder into the client-side world of the popular jQuery JavaScript library. This book will show you how to use jQuery to enhance your PHP applications, with many examples using jQuery's user interface library jQuery UI, and other examples using popular jQuery plugins. It will help you to add exciting user interface features to liven up your PHP applications without having to become a master of client-side JavaScript. This book will teach you how to use jQuery to create some really stunning effects, but without you needing to have in-depth knowledge of how jQuery works. It provides you with everything you need to build practical user interfaces for everything from graphics manipulation to drag-and-drop to data searching, and much more. The book also provides practical demonstrations of PHP and jQuery and explains those examples, rather than starting from how JavaScript works and how it is different from PHP. By the end of this book, you should be able to take any PHP application you have written, and transform it into a responsive, user-friendly interface, with capabilities you would not have dreamed of being able to achieve, all in just a few lines of JavaScript.
Table of Contents (16 chapters)
jQuery 1.3 with PHP
Credits
About the Author
About the Reviewers
Preface
Index

Why jQuery?


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.