- What is Ajax?
AJAX is not a new programming language, but a new technique for creating better, faster,and more interactive web applications.
Ajax stands for 'Asynchronous JavaScript and XML'
With AJAX, a JavaScript can communicate directly with the server, with the XMLHttpRequest object. With this object, a JavaScript can trade data with a web server, without reloading the page.
Ajax stands for 'Asynchronous JavaScript and XML'
With AJAX, a JavaScript can communicate directly with the server, with the XMLHttpRequest object. With this object, a JavaScript can trade data with a web server, without reloading the page.
- Ajax is based on which web standards?
- XML
- HTML
- CSS
- What is Asynchronous?
- How does Ajax works?
With the XMLHttpRequest object, a web page can make a request to, and get a response from a web server - without reloading the page. The user will stay on the same page, and he or she will not notice that scripts request pages, or send data to a server in the background.
The XMLHttpRequest object is supported in all major browsers (Internet Explorer, Firefox, Chrome, Opera, and Safari). All new browsers use the built-in JavaScript XMLHttpRequest object to create an XMLHttpRequest object (IE5 and IE6 uses an ActiveXObject).
- What are the important properties of XMLHttpRequest object
After a request to a server, we need a function to receive the data returned from the server.The onreadystatechange property stores the function that will process the response from a server. The function is stored in the property to be called automatically.
The readyState property holds the status of the server's response. Each time the readyState property changes, the onreadystatechange function will be executed.
- responseText property
The data sent back from a server can be retrieved with the responseText property.
- How do we send response to the server?
The open() method takes three arguments. The first argument defines which method to use when sending the request (GET or POST). The second argument specifies the URL of the server-side script. The third argument specifies that the request should be handled asynchronously.
The send() method sends the request off to the server.