Ajax Request Cycle
- The server creates a page with user controls (e.g. links, menus, buttons) and javascript.
- The browser displays the page.
- A user performs an action (e.g. clicks on a link, presses a button), which executes javascript statements in the browser.
- The javascript initiates an XMLHTTPRequest (XHR) to the server requesting specific data.
- The server responds with the requested data.
- The javascript on the browser places the requested data within
HTML tags designated by the id attribute.
In step 5, we will see that sometimes the server sends javascript
code in addition to data. In this case, the browser would then
execute this code in step 6.