Categories Photography Résumé About Me

Gracefully Degrading AJAX with PHP and jQuery

19 Aug 2009

PHP LogoJquery LogoThe object of this tutorial is to introduce methods that can be used in just about any situation to provide gracefully degrading form post functionality that works with or without javascript. The form will be a lot nicer with javascript because it can do so without a complete page request and response. This is important to you and me because while we want fancy asynchronous data transfer on the web, we also don't want to alienate people who browse without Javascript or use a dinosaur browser which can't handle it. Asynchronous data requests and responses are much quicker because you can send and receive much less data than a full page response. This speeds almost everything up considerably.

The Form</h3> The form is an integral part of this process as it provides the framework for the data that is to be sent to the script that processes it. The example I will be using today is a newsletter sign up form. The form code we'll be using for the example is below.