Appendix E. Porting Server-Side Techniques

 

Ajax is essentially a client-side technology, and Prototype and Scriptaculous are client-side libraries. This gives us the luxury of being able to present code that will run against any server-side language. We’ve tried to emphasize this point by presenting the necessary supporting server-side code in a number of languages, but we realize that we can’t please everyone. We’ve emphasized Java and PHP over .NET and Ruby in this book, and that choice was essentially arbitrary.

Most of the time, writing server-side code for Ajax is pretty much the same as writing server-side code for any web application. We’re still using HTTP, after all, and we don’t need to show you how to read querystring parameters in the programming languages that you’re already familiar with. However, when using Ajax, we have better control over the low-level details of HTTP, allowing us to create requests that don’t look quite the same as those originating from a classic web app. We therefore need to handle these requests a little differently on the server.

To assist in the translation of our coding techniques to languages other than the ones that we covered in detail so far, we’re going to point out a few of the less common things that we’ve done, and show how to make them work in the language of your choice.

E.1. Reading request headers

 
 
 

E.2. Adding response headers

 
 
 

E.3. Reading a POST request body

 
 
 

E.4. Summary

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage