XMLHttpRequest is a built-in JavaScript object used to communicate with the server.
It allows sending and receiving data without reloading the web page.
This object is the foundation of traditional AJAX.
The XMLHttpRequest object creates a connection between the browser and the server.
All AJAX requests are made using this object.
Once created, the XMLHttpRequest object can send requests using different HTTP methods.
Common methods include GET and POST.
The request is sent to the server using the send method.
The browser continues working while waiting for the response.
After the server processes the request, the response is returned to the browser.
JavaScript then handles the response data.
XMLHttpRequest works asynchronously, which prevents page freezing and improves performance.
After completing this lesson, you now understand what XMLHttpRequest is and why it is used in AJAX communication.