␡
- Recipe: Setting Up an Example Server in Node.js
- Recipe: Performing a GET Request
- Recipe: Loading HTML Directly
- Recipe: Handling the Result by Using Promises
- Recipe: Handling Server Errors
- Recipe: Catching Page-not-Found Results
- Recipe: Handling Page Redirects
- Recipe: Setting Request Timeouts
- Recipe: Passing HTTP Headers
- Example: Validating Form Input on the Server Side
- Recipe: Loading XML
- Recipe: Listening to AJAX Events
- Recipe: Reading JSONP from an External Server
- Summary
< Back
Page 14 of 14
This chapter is from the book
Summary
This chapter covered the most common uses of AJAX. The recipes cover fetching JSON, HTML, and XML, as well as many error scenarios. You can pass HTTP headers, validate form input in the background, and listen for AJAX events in general. The last recipe showed a dirty hack to load data from other servers by using JSONP. Because of security risks and a lack of error handling, it is better to avoid JSONP.
< Back
Page 14 of 14