Home / Interview / AJAX :: General Questions

Interview :: AJAX

1) What is AJAX?

AJAX stands for Asynchronous JavaScript and XML. It is a group of related technologies used to display data asynchronously. In other words, it sends and retrieves data without reloading the web page.

2) What are the advantages of AJAX?
  • Quick Response
  • Bandwidth utilization
  • The user is not blocked until data is retrieved from the server.
  • It allows us to send only important data to the server.
  • It makes the application interactive and faster.
3) What are the disadvantages of AJAX?
  • Dependent on JavaScript
  • Security issues
  • Debugging is difficult
4)

What are the real web applications of AJAX currently running in the market?

  • Twitter
  • Facebook
  • Gmail
  • Freshergate
  • Youtube
5) What are the security issues with AJAX?
  • AJAX source code is readable
  • Attackers can insert the script into the system
6)

What is the difference between synchronous and asynchronous requests?

Synchronous request blocks the user until a response is retrieved whereas asynchronous doesn't block the user.

Synchronous Request

synchronous request

 

Asynchronous Request

asynchronous request

 

7) What are the technologies used by AJAX?
  • HTML/XHTML and CSS - These technologies are used for displaying content and style.
  • DOM - It is used for dynamic display and interaction with data.
  • XML - It is used for carrying data to and from server
  • XMLHttpRequest - It is used for asynchronous communication between client and server.
  • JavaScript - It is used mainly for client-side validation
8) What is the purpose of XMLHttpRequest?
  • It sends data in the background to the server.
  • It requests data from the server.
  • It receives data from the server.
  • It updates data without reloading the page.
9) What are the properties of XMLHttpRequest?

The important properties of the XMLHttpRequest object are given below.

  • onReadyStateChange - It is called whenever readystate attribute changes.
  • readyState - It represents the state of the request.
  • responseText - It returns response as text.
  • responseXML - It returns response as XML.
  • status - It returns the status number of a request.
  • statusText - It returns the details of status.
10) What are the important methods of XMLHttpRequest?
  • abort() - It is used to cancel the current request.
  • getAllResponseHeaders() - It returns the header details.
  • getResponseHeader() - It returns the specific header details.
  • open() - It is used to open the request.
  • send() - It is used to send the request.
  • setRequestHeader() - It adds request header.