Understand Basic form validation and form handling tools Learn Debugging and troubleshooting techniques to make your site perform even quicker Integrate Web 2.0 APIs for Flickr, Picasa, Facebook and Twitter Build chat application using Comet technology Write optimized code using Ajax asynchronous calls to improve website responsiveness Implement best practices to build SEO-friendly websites Become a skilled iPhone app developer using Ajax
I recently finished reading my first "cookbook" style programming book: PHP Ajax Cookbook: This is my first cookbook review, so I thought I'd start by clarifying what this is and is not. It is not a textbook-style book, similar to "Learn Ajax in 21 days". It is also not a reference book that you can sit on your bookshelf and pull down when you need to look something up. It's a survey of a wide variety of basic techniques that can be implemented with Ajax techniques and how they're done. You should be familiar with both PHP, JavaScript, and CSS before picking this up, or you will get REALLY lost.With that said, I thoroughly enjoyed this book. I recommend going ahead and downloading the source code files (there's a registration, but it's painless). Some examples are fairly lengthy, and you'll want the source code handy. In fact, this book is between 30% and 50% code!The layout of the book is chapter around a main concept. Each chapter has several sections, each devoted to a single example. For every example, several things are provided: an overview of what the goal is, the code to implement a simple example (enough for you to build a real-world product), an explanation of how it works, often nearly line-by-line, and a "There's more..." section that gives you additional resources and ideas.Chapter 1 gives you a quick orientation to JavaScript libraries that will make doing Ajax a lot easier. The practical examples will give you a sense of the style of jQuery, Ext JS, MochiKit, Dojo, YIU, MooTools, and prototype.js. You'll have to learn them on your own, but you will get a sense of how they work, and what they're like. The authors use jQuery for the rest of the book. It's worth using one of these libraries, because raw JavaScript makes doing Ajax calls awkward. The elegance these provide for coding is worth the effort.Chapter 2 goes over basic Ajaxy things. Form validation (really just jQuery form validation), autosuggest (similar to Google's search), creating a multi-step form wizard, file updload, multi-file upload using Ajax + Flash, implementing a 5-star rating system, etc. The purpose of this chapter is to expose you to how easy Ajax effects are to implement. It's generally a simple combination of CSS and small bits of jQuery that have a powerful effect.Chapter 3 looks heavily at the extensions that are available for jQuery. Often there are several options (with links provided) of which one is chosen for demonstration purposes. If you're interested in using jQuery, this chapter will provide you with a wealth of resources to give you ideas for cool things you can do. Examples include an image slider, a Lightbox image loader, a shopping cart, and data sorting/filtering.Chapter 4 pushes this further, showing how to create a chat system and how to decode a simple CAPTCHA using the HTML5 canvas element. These examples are very detailed and will give you a solid idea of the power that is present. One of the key things you will learn is how to do this without using excessive Ajax calls. You can easily kill a server's bandwidth with the "obvious" solution. Thi shows you how to avoid that.Chapter 5 goes in a completely different direction: debugging. It discusses using Firebug and FirePHP, including the details of how to set both up, in Firefox. It discusses the IE developer toolbar. Memory leaks are dealt with in detail, as are how to deal with various timing issues that can crop up. If you've done PHP/HTML/JavaScript debugging, you already know how annoying this can be. I picked up several tricks, and I thought I was Firebug-savvy!Chapter 6 discusses optimization issues, including the use of Yslow. It's very easy to make an Ajax site that works poorly, so these tips will help a lot. It discusses where to place sections of code, caching concerns, etc. Most of these are tips you can find in numerous other sites, but they are nicely consolidated, here.Chapter 7 discusses other best practices, including security concerns and how to address SEO concerns when dealing with dynamic content. Having SEO friendly content means having static content with fixed URL's for each content item. Having Ajaxy content is basically the opposite. This chapter has numerous tips on how to satisfy both requirements, so users can easily find your content.Chapter 8 discusses ways to use various services that have API's, such as Flickr, Twitter, and Google Maps. These are techniques that can make a website "pop", such as getting a list of nearby restaurants with a map, a customized twitter feed, or image search. As usual, you won't learn the full API, but you will learn the basic techniques for leveraging these APIs on your own site.Chapter 9 was the most surprising for me. Building iPhone apps using html, Ajax, and PhoneGap. It can also be used for building Android apps, but the authors focused on the iPhone. PhoneGap is a tool that lets you compile an HTML/Ajax page into a native app for the iPhone, Android, etc. It's a tool I'd never heard of, but offers a huge amount of options for the mobile development market.I enjoyed the book. There's a TON of information here, and the timing was ideal, as I'll be designing a new PHP/Ajax app for my job at work. Topics range from basics of using a framework, to quality layouts, to security concerns. The details will be found elsewhere, but the core ideas are all in here.
Amazon Verified review
DaedalusMar 23, 2012
5
The book focuses primarily on the client-side implementations of Ajax tasks common for almost any web 2.0 application. PHP examples are included where necessary for server interaction.Most of the examples use jQuery but the book does touch on some other popular JavaScript frameworks including jQuery, Ext JS, MochiKit, Dojo, and YUI library and compares their strengths and weaknesses in different scenarios. There is an entire chapter devoted to the most useful jQuery and jQuery UI plugins including tab navigation, image animation and effects, lightbox, datepicker.The book begins with fairly trivial examples such as form validation, autosuggest and rating systems but gradually increase in complexity to using canvas for captchas and building two way communication systems using comet. There are also examples of how to implement JavaScript and PHP code to interact with many of the popular webservices online (eg. Google Maps, Facebook, Flickr, IP/Country Lookup, etc.) to create effective mashup sites.Interestingly, they also cover iPhone webapp development from an HTML5 perspective and also using the PhoneGap framework to access mobile phone hardware features from a web development context. I guess this is a sign of the times and the pervasiveness of the iPhone...It includes chapters on tools and techniques for debugging JavaScript and techniques for optimizing your code for faster page load times. For someone getting into JavaScript development, this section will be extremely beneficial. Veterans may already be familiar with most of the debugging tools suggested but I learned several cool tricks here.In most cases, the samples are not watered down with heavy CSS or markup. This allows the code to speak for itself and makes the examples fairly easy to understand if you have a sufficient programming background. This is as a cookbook should be. All in all, it's a great reference of recipes for many of the common features expected in a web 2.0 application. I'm sure I'll be referring back to this for future projects!
Amazon Verified review
Ivan IlijasicMar 03, 2012
5
I've been in PHP development for more than 10 years and this book is really useful material.I could recommend it to beginners and experienced developers. From my point of view, there are three types of developer books - complete byte-to-byte fat books, introduction books and cookbooks. I want my cookbook to have useful and simple to use recipes. This book fullfilled my expectations.Chapter 1 tells about different mainstream JS libraries and framework. You cannot expect from this kind of a book to cover so much information but it's useful to see what is out there. At least you can find useful links or create a list of JS frameworks you should look for.Almost all the rest this book is all about PHP and jQuery. It has lots of recipes that cover typical developer scenarios. How to create form validation, file upload, dynamic containers such as tab navigators or slideshow, pageless pagination but it goes futher. There are some simple examples how to create drag & drop functionality, sorting, filtering. All common functionalities and I like to see them in one book.There are some interesting chapters about debugging PHP / JS applications and about best practices how to secure your Ajax applications. Perhaps it would be useful to see addtional pages about PHP security. I know this is a book about PHP and Ajax, not just about PHP but pages about security can be pure gold. Fortunately, this book offers excellent information about online resources.Mashups chapters talks about usage of common web services. There is one really useful chapter how to create a Google map search in specified radius - how to use PHP, Ajax, Google Map API and MySql. Just like chapter 1 it doesn't go in many details but it gives you enough useful links and library references.Since I recently started developing HTML mobile apps, I was very pleased to see this topic in this cookbook. That's why it's really nice to see last chapter about PhoneGap.Recipes in this cookbook are not offering fancy CSS examples with lot of graphics. They are offering pure ideas and solutions.That's really what every PHP developer should have on his shelf. I would definitely recommend this book. Simple but veeeery useful.
Amazon Verified review
Alex FApr 04, 2012
3
The sub-title for this book, "Over 60 simple but incredibly effective recipes to Ajaxify PHP websites" is accurate, and if that is what you are looking for, then this book does a good job delivering on it. Many programming training books take you through a single project from start to finish to help the reader gain a deeper understanding of the language or techniques being employed. This is not that style of book. Although the entire volume does flow together for the most part, it seems to work better as a reference to solve a particular problem, or as the title would suggest, a cookbook where you pick the recipe for the task you wish to complete.I feel it is important to note that a book like this is not for novices. Before reading this book, the reader should already be comfortable with PHP and the server end of their application. The reader would hopefully have a basic understanding of JavaScript structure or at least the jQuery JavaScript library which is used for the vast majority of examples in this book. Without this understanding going in, I fear that the reader will be faced with a great deal of confusion and frustration when trying to understand and learn from the examples given. As some newbies may not be aware, it is necessary to employ JavaScript to use AJAX functionality.Chapter 1 uses a variety of JavaScript libraries to complete an assortment of AJAX tasks commonly requested in modern web applications. It helps to show some of the strengths and weaknesses of the different libraries. After chapter 1, the jQuery library will be used for all examples.Chapter 2 shows possible solutions to several common tasks using the jQuery library and AJAX functionality such as form validation, auto-suggest, file uploading, a rating system and pagination. Many of the solutions simply employ the use of a jQuery plug-in to do the heavy lifting. This is fine if your goal is to accomplish the task at hand in an efficient manner. Although each section contains a "How it works..." paragraph, if your goal is to learn and understand WHY it works, this chapter will leave you wanting more.Chapter 3 continues where chapter 2 ended and addresses tasks such as tool tips, auto-complete, tabbed navigation, an image slider, using a lightbox, drag and drop functionality, a simple shopping cart, and some animation. As in chapter 2, you will not really be doing any programming. You will be using jQuery plugins and the jQuery UI (User Interface) library to accomplish these tasks. Again, there is not anything wrong with this approach if you simply want to add some AJAX functionality to your website.Chapter 4 covers some more advanced AJAX utilities that will be used on fewer websites such as using a Comet server for live chat, using Google's API to create charts, a very basic OCR (Optical Character Recognition) with very limited practical use, displaying data.Chapter 5, 6 and 7 seems to take a departure from the previous intended audience. I found these chapters to be filled with useful techniques for debugging and optimizing the JavaScript used for the AJAX functionality. They go over more advanced techniques beyond simply making a plugin work. If the reader does not have an adequate understanding of JavaScript and AJAX by this point, I fear that this chapter would largely be lost on them.Chapter 8 gives a very brief overview of web services and the most popular formats of them in use at this time. It gives examples of one way to access the API (Application Programming Interface) for Flickr, Twitter, and a few of Google's web services. Some of the examples use PHP on the server side (using CURL), and some use a client side JavaScript interface. I feel that it is important to note that the examples shown are not the only ways to interact with these API's. I do have to point out that there is one rather interesting subject covered in this chapter. The book shows an example of how to locate addresses (retrieved from your database) within certain radius of a certain location using Google's map API.Chapter 9 covers some basics to keep in mind when beginning to create a version of your web application targeting mobile devices, specifically the iPhone. It briefly covers a couple mobile JavaScript frameworks that assist with this task. This chapter also covers a service called PhoneGap, which allows conversion of HTML, CSS and JavaScript into a native phone application.In summary, when deciding whether this is a good book for you to purchase, you must really examine what it is that you hope to learn. If you have a solid grasp on the PHP needed for your application, have a basic knowledge of JavaScript and simply want to add some cool effects to your site, then you will probably be very pleased with this book. If you choose to learn more about JavaScript and AJAX from other resources, then the later chapters will also be of use to you. If you are brand new to JavaScript and AJAX, or if you want to build a deep understanding of JavaScript, AJAX or jQuery with the intention of being able to build customized functionality for your website, then this is probably not the best book for you. There are many fine publications that can take you from novice to adept programmer, but that is not the goal of this book. After all, you don't read a cookbook to learn how to cook.Disclosure: I was provided with a free copy of this book in return for reviewing it.
Amazon Verified review
webdevNov 23, 2012
2
Very disappointed with this book. If you're not already familiar with jQuery, this book will teach you some very poor coding habits, like building placeholder blocks of HTML into your markup rather than generating them dynamically with JS, not to mention the bloated and unnecessary code to do simple things. The PHP in the book is also disappointing, providing almost no server side functionality, and even less in regards to "practical" server side functionality.None of these recipes provide anything of a dynamic nature, relying mostly on static chunks of HTML in place of server side data.Formatting is also a mess. Code is scattered and in some cases, missing.Also, at least 1/3 of the source code is omitted from the publisher's downloadable files. It's sad when books like this pass a publisher's standards.
A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content
How can I cancel my subscription?
To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.
What are credits?
Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.
What happens if an Early Access Course is cancelled?
Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.
Where can I send feedback about an Early Access title?
If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team.
Can I download the code files for Early Access titles?
We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.
When we publish the book, the code files will also be available to download from the Packt website.
How accurate is the publication date?
The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.
How will I know when new chapters are ready?
We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.
I am a Packt subscriber, do I get Early Access?
Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.
How is Early Access delivered?
Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.
How do I buy Early Access content?
Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.
What is Early Access?
Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.