February 2019
Beginner to intermediate
284 pages
6h 20m
English
The standard way to load data into a Web page is using asynchronous JavaScript and XML, or Ajax. It uses the standard built-in XMLHttpRequest object, supported by all modern browsers.
To load a file using XMLHttpRequest, you need to create the XMLHttpRequest object, choose an HTTP method, use the object to open an HTTP connection to the file's URL, and send the request. You must also create a callback function that listens to the object's 'readystatechange' event and test the object's readystate property.
When this property contains XMLHttpRequest.DONE, the request is done and you can extract the data. But it's not finished yet! If the request finished successfully (the object status property equals ...
Read now
Unlock full access