Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

What does xmlhttprequest do in smooth state.js?


Asked by Frankie Santos on Dec 15, 2021 FAQ



smoothState.js makes AJAX requests using XMLHttpRequest, which silently follows redirects. This transparence prevents smoothState.js from knowing if a request resulted in a redirection. For example, when you visit /about and the server redirects you to /about/company, smoothState.js is only ever informed of a successful response from /about.
In addition,
The XMLHttpRequest object can be used to request data from a web server. The XMLHttpRequest object is a developers dream, because you can: Update a web page without reloading the page Request data from a server - after the page has loaded
Moreover, The readyState property defines the current state of the XMLHttpRequest object. The following table provides a list of the possible values for the readyState property − The request is not initialized. The request has been set up. The request has been sent. The request is in process. The request is completed.
Additionally,
The XMLHttpRequest object is a developer's dream, because you can: 1 Update a web page without reloading the page 2 Request data from a server - after the page has loaded 3 Receive data from a server - after the page has loaded 4 Send data to a server - in the background
Also,
If a synchronous call takes too much time, the browser may suggest to close the “hanging” webpage. Many advanced capabilities of XMLHttpRequest, like requesting from another domain or specifying a timeout, are unavailable for synchronous requests. Also, as you can see, no progress indication.