I’m happy to say that I should (hopefully) be finishing the first draft of the fourth edition of my “PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide” this week. Today I’ll finish one of the new chapters, introducing jQuery. The chapter’s a bit longer than I had originally hoped (30+ pages), but I think it works very well.
The chapter begins with a discussion of jQuery and JavaScript, and a sidebar on the best development tools to assist in your JavaScript programming (or, more importantly, debugging). Then the chapter shows how to incorporate the jQuery library and how to do a simple test of it. Next, you’ll learn how to select page elements using jQuery, and write an HTML form for the example to follow. After that is coverage of event handling and DOM manipulation, which will round out the example.
The first specific example is a widget cost calculator (similar to one done in PHP earlier in the book), with JavaScript performing the calculations and jQuery being used to show and hide error messages, change the classes assigned to elements, and update the content of the page.
The chapter concludes with several pages on Ajax. That specific example is a login form, with a server-side PHP script validating the login data, and jQuery updating the page appropriately.
I think the chapter presents a good introduction to jQuery, within the context of the entire book. Thanks to the new “Review and Pursue” section, many ideas for where to learn more or to practice what you’ve just learned are suggested.
As I said, I should be submitting this chapter today. Over the week I’ll finish the last remaining chapter: another new one introducing Object-Oriented Programming in PHP. After that, there’s just the appendix and introduction, neither of which will take much time. So I’ll have the first draft of the book done by the end of the month, and I’ve already completed seven chapters of the rewrites. I think the new edition is turning out well, and I’ll be happy to have it complete and on its way to the printer in July!