Chapter 9.1.1. Ajax Requests/HTML Responses

An HTML request is definitely the easiest to understand. Your browser makes a request to the server, you return HTML, and the browser hands it back to some JavaScript that will render that HTML at some point in your page. Because it is so simple, and most of the HTML construction work is done on the server, it’s often the easiest way to go.

For example, the WhatWhat Status people have methods in the ProjectController that send back an HTML fragment. create_note takes a string as a parameter from the Ajax request that calls it. It then gets the current user ID from the identity object, uses the _active_project_id() function to get the current project ID from a cookie, and saves all of this to the ...

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.