important for the interview purpose. These are discussed below.
1. open() : Assigns method, destination URL, and other optional attributes of a
pending request.
This open method will open the communication channel between the client and
server to send the request
It takes 3 parameters as open(method, url, bool)
a) method: It indicates how the data is transmits between2. send() : Sends an HTTP request to the server and receives a response.
the client and the server. It can be either get or post. In general get is used
as there is less data transmissions.
b) url: It specifies the address of the webpage where the request needs
to be processed.
c) bool: It can be either true or false. True indicates Asynchronous
Requests and False indicates Synchronous Requests.
It sends the request to the server by using the communication channel prepared
by the open method.
These are the important methods of XMLHttpRequest Object. To view all the methods click here.
Points To Remember:
The open method prepares the communication channel by specifying the method, url
and the type of request, then the send method sends the request using the
communication channel prepared by the open method.
Go to Lesson 7
or
View All The Methods