Some common Ajax interview questions and answers include topics such as the basic principles of Ajax, the differences between Ajax and traditional web applications, and common Ajax techniques such as using XMLHttpRequest, JSON, and jQuery. Other potential questions may touch on best practices for implementing Ajax in web applications, security considerations, and how to handle errors and exceptions in Ajax requests.
What is Ajax?
What are Ajax applications?
Ans: Browser based applications and platform independent applications are used by Ajax.
What are the advantages of Ajax?
Ans: Following are the advantages of Ajax:
- Bandwidth utilization
- It saves memory when the data is fetched from the same page.
- More interactive
- Speeder retrieval of data
What are the disadvantages of Ajax?
Ans: Following are the disadvantages of Ajax:
- Source code written in AJAX is easily human readable. There will be some security issues in Ajax.
- Debugging is difficult (not impossible)
- Increases size of the requests
- Slow and unreliable network connection.
- Problem with browser back button when using AJAX enabled pages.
What are all the technologies used by Ajax?
Ans: AJAX uses following technologies:
- Document Object Model (DOM)
- Extensible HTML (XHTML)
- Cascading Style Sheets (CSS)
What Is the Format of an AJAX Request?
Ans: An AJAX request can be in any format:
- Text File
- JSON object
How many types of triggers are present in update panel?
Ans: There are two types of triggers used in update panel:
- PostBackTrigger : This works as full postback and it cannot work asynchronously
- AsyncPostBackTrigger : Partial post back asynchronously
Is an AJAX Request Synchronous or Asynchronous?
Ans: AJAX requests are asynchronous by nature, which means that they should run in the background independently of other events.
What are the security issues with AJAX?
Ans: The Ajax calls are sent in plain text format, this might lead to insecure database access. The data gets stored on the clients browser, thus making the data available to anyone. It also allows monitoring browsing sessions by inserting scripts.
Is AJAX code cross browser compatible?
What are all the browsers support AJAX?
Ans: Following browsers support AJAX:
- Internet Explorer 5.0 and above
- Opera 7.6 and above
- Netscape 7.1 and above
- Safari 1.2 and above
How can you test the Ajax code?
How can you find out that an AJAX request has been completed?
Ans: ReadyState property is used to check whether AJAX request has been completed. If the property is equal to four, then the request has been completed and data is available.
What is JSON in Ajax?
What are all the different data types that JSON supports?
Ans: JSON supports following data types: