Appendix B. Review of the XMLHttpRequest API

This appendix covers

  • A review of the XMLHttpRequest API
  • The building of an XHR data source module

In this appendix, you’ll review the low-level API for making a server call. In a real-world application, you’ll likely rely on your MV* framework for XHR calls if it has this capability built in or a helper library such as jQuery if it doesn’t. These frameworks and libraries often abstract away much of the boilerplate code and provide you with simple, easy-to-use methods instead. Even so, it’s good to have at least a general idea of what’s going on under the covers. That’s why I’ll stick with vanilla JavaScript here, so you can see basic XHR mechanics at work. I’ll also not be using RESTful calls ...

Get SPA Design and Architecture: Understanding single-page web applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.