Free Trial

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

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Summary

In this chapter, you learned about Ajax. You first started off with a short history lesson about the origins of Ajax in its early days with Microsoft and then learned about how it came to be in its current form, along with the difference between synchronous and asynchronous server communication.

We broke down the individual pieces of the famous XMLHttpRequest, including open and send methods and the kinds of information that can be passed into each of them. We introduced a new JavaScript event called readyState, which is triggered by the Ajax call itself and returns five different state values you can check against before executing a block of code after a call has completed.

We talked about the different data formats that can be used when dealing with Ajax, namely: JSON, HTML and XML, and visited some positive and negative aspects of each, including some use-cases for each in the event you hit a time where you may want to use one over the other.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint