Section 2.32. What is the browser doing?


2.32. What is the browser doing?

You've seen what the Break Neck server is doing, and you're written a lot of new JavaScript, but what's the browser doing as all these ready states are changing?

Let's take a look and find out:

     Web BrowserThese are the request's ready states.     11. The browser runs getCustomerInfo(), and a request is made to the Break Neck web server.     22. As the request is being worked on, the ready state of the request is changed to reflect what stage of processing the request is in.     33. Each time the ready state of the request changes, the browser runs your callback function, updatePage().       PHP script     4updatePage()4. updatePage() checks the request object's ready state, and only keeps running if the request is finished.     JavaScript     55. When the browser gets a completed response from the server, it stores the server's response in the request object.     66. If the request is finished, updatePage() can get the server's response from the request object. 

The browser makes a server's response available to your code through the JavaScript request object.




Head Rush Ajax
Head Rush Ajax (Head First)
ISBN: 0596102259
EAN: 2147483647
Year: 2004
Pages: 241

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net