A McGraw Hill Book Plug-in PHP: 100 Power Solutions
By Robin Nixon (McGraw Hill 2010, ISBN 978-0071666596)

Home | About | Buy It | Download | Contact

Select Chapter: 1  2  3  4  5  6  7  8  9 10 11 12

Chapter 11: Plug-in 82 - Post Ajax Request

The previous plug-in provides a means of creating an XMLHttpRequest object, with which this plug-in makes a POST request to the server to request some data to be transferred back to the browser. Both of these requests happen seamlessly in the background with the user generally unaware that such things are taking place. A POST request is where data is sent to the server within header messages, rather than as part of a URL tail (or query string), as in GET requests.

The Figure shows this plug-in being used to load Facebook's mobile website main page at m.facebook.com, replacing the contents of a <div>...</div> pair of tags.