PhpRiot
Download Article
Download this article or the entire “Eight Weeks of Prototype” series with all listings and files.




More information
Related Books
Prototype and Scriptaculous in Action [Ajax]

Prototype and Scriptaculous in Action [Ajax]

"This book should rightly be considered the bible of Prototype and Scriptaculous." --...
PhpRiot Newsletter
Your Email Address:

More information

Eight Weeks of Prototype: Week 5, Ajax with Prototype

Summary

In this article I showed you how to perform Ajax requests using the Ajax.Request provided by Prototype. This class is a wrapper to the XMLHttpRequest object that modern browsers have. I showed you how to specify options when performing a request, including how to specify the callback handlers to deal with the response from the HTTP sub-request.

Additionally, I introduced you to JSON data and how to send JSON data with PHP, and receive it in the Ajax response. While the examples given were mostly conceptual, hopefully they gave you a good idea of how you can use Ajax in your own applications. In the eighth article of this series a larger, more concrete example will be given when I bring together all of the Prototype functionality covered in this series.

In the next article I will show you how to create JavaScript classes in Prototype. If you prefer an object-oriented approach to your programming, you will find this article invaluable, since knowing how to effectively create classes will give your code a much better overall structure.

Other Options

In This Article