Chapter 15.1.5. Limitations of Ajax

The JavaScript security model prevents JavaScript code from making requests to servers other than the one the page originated on. A common desire today is to aggregate data that comes from different services. For example, if you have a business management application, you might want to pull census data for a specific city from another website.

One solution to this problem is to proxy the request through your application. The user’s browser will make an Ajax call to your TurboGears application, which will then make its own HTTP request or requests to retrieve the data from the other server. This solution works, but you end up paying the bandwidth bill to pull the data down to your server and then pass it ...

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.