Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

CHAPTER 14: Using Ajax: Part I > Using the Ajax Shorthand Methods - Pg. 402

CHAPTER 14 USING AJAX: PART I Perform an asynchronous HTTP POST request. Send nonform data in a POST request. Use the post method. 9, 10 Pass any JavaScript object as an argument to the post method. Pass the expected type as an argument to the get or post methods. Don't treat Ajax requests as though they were synchronous. Use the load, getScript, or getJSON method. Use the Ajax Forms plugin. 11 Override the data type specified by the server in the response to an Ajax request. Avoid the most common Ajax pitfall. 12­13 14 Use the convenience methods to make GET requests for specific data types. Easily enable Ajax for form elements. 15­18 19 Using the Ajax Shorthand Methods Although Ajax is usually associated with posting form data, it can actually be used a lot more widely. I am going to start introducing Ajax by performing some simpler tasks, starting with some different ways that you can obtain data from the server without using forms at all.