What is AJAX?
AJAX stands for Asynchronous JavaScript and XML. It is a group of related technologies to display data asynchronously.
2) What are the advantages of AJAX?
• Quick Response
• Bandwidth utilization
• User is not blocked until data is retrieved from the server.
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
• Javatpoint
• Youtube etc.
5) What are the security issues with AJAX?
• AJAX source code is readable
• Attackers can insert script into the system
6) What is the difference between synchronous and asynchronous requests?
Synchronous request blocks the user until response is retrieved whereas asynchronous doesn't block the user.
7) What are the technologies used by AJAX?
• HTML/XHTML and CSS
• DOM
• XML
• XMLHttpRequest
• JavaScript
8) What does XMLHttpRequest?
• sends data in the background
• receives data
• updates data without reloading the page
9) What are the properties of XMLHttpRequest?
The important properties of XMLHttpRequest object are given below.
• onReadyStateChange
• readyState
• responseText
• responseXML
10) What are the important methods of XMLHttpRequest?
• open()
• send()
• setRequestHeader()
11) What is JSON in AJAX?
JSON stands for JavaScript Object Notation. It is easy to understand and data exchange is fast than XML. It supports array.
12) What are the tools for debugging AJAX applications?
There are two most widely used tools for debugging AJAX applications.
• Firebug for Mozilla Firefox
• Fiddler for IE (Internet Explorer)
13) What are the types of post back in AJAX?
There are two types of post back in AJAX.
• Synchronous Postback
• Asynchronous Postback
14) What are the different ready states of a request in AJAX?
There are 5 ready states of a request in AJAX.
• 0 means UNOPENED
• 1 means OPENED
• 2 means HEADERS_RECEIVED
• 3 means LOADING
• 4 means DONE
15) What are the common AJAX frameworks?
• Dojo Toolkit
• YUI
• Google Web Toolkit (GWT)
• Spry
• MooTools
• Prototype
16) How can you test the AJAX code?
JsUnit is the open source unit testing framework for client side JavaScript. It is a part of JUnit.
17) What is the difference between JavaScript and AJAX?
JavaScript makes a request to the server and waits for the response. It consumes more bandwidth as it reloads the page. AJAX sends a request to the server and doesn't wait for the response. It doesn't reload the page so consumes less bandwidth. Ajax is a client-side script that communicates with server without refresh the complete page. You can also say " the method of exchanging data with a server, and updating parts of a web page without reloading the entire page ". Ajax is used in all web-technology like PHP, ASP, Java and Mobile Technology etc.
Question: What is Ajax?
AJAX (Asynchronous JavaScript and XML) is a client-side script which is used to get the data from Server.
Question: Why Ajax is used?
Ajax is used to get the data from server without refreshing the current page.
Question: When we can use Ajax? Give Few Examples?
Ajax can be used to get the data from Server when you don't want to refresh the page. See Below Scenario:
• In Registration Page, check the username is available OR NOT.
• In Registration page, check email address is already taken OR NOT.
• In Product Listing page, when user click on "Next" under pagination, you won't want to show the next page data without refreshing the page.
Question: What files need to install to use Ajax in Website?
Initially, no files required to use the ajax in your website.
But to manage your ajax call in better way, you can use JS library which world used to use.
Question: What js library are available to use the Ajax?
Following are few JS library which are used for Ajax
• JQuery
• MooTools
• Prototype
• YUI Library
• Backbone js
Question: What Browsers support Ajax?
Today, All the Browser support ajax. Following are minium version of browser which support Ajax.
• Internet Explorer 5.0 and up,
• Opera 7.6 and up,
• Netscape 7.1 and up,
• Firefox 1.0 and up,
• Safari 1.2 and up,
Question: What is XMLHttpRequest?
XMLHttpRequest is an API available to web browser scripting languages (i.e. JavaScript). It is used to send HTTP/HTTPS requests to a web server and load the server's response into the script.
Question: How we can send data to server using Ajax?
We can use GET OR POST Method to send data.
Question: What is Asynchronous in Ajax?
We can set the Asynchronous value as true OR false.
Async=true
Ajax request execute independently, Its response can come earlier than other request which is execute later .
Async=true
Ajax request does not execute independently, Its response can comes when earlier request finished.
Question: What do the different readystates in XMLHttpRequest?
Following are different stats(0-4) of ready state in XMLHttpRequest
0 Ajax Request not initialized
1 Ajax Request's server connection established
2 Ajax Request received
3 Ajax Request processing
4 request finished and response is ready.
Question: Can I send Ajax Request to another domain?
No, you can't do this.
Question: What are advantage of AJax?
• Its faster as it load only required content.
• More user friendly.
• One page application possible due to Ajax.
• Reduce the loading of page.
Question: What are disadvantage of Ajax?
It does not crawl to search Engine.
Question: Define JSON?
JSON is JavaScript O bject Notation.
Question: What type of response we can get in Ajax Response?
• text data
• html data
• JSON data
• XML data
Question: Describe how to handle concurrent AJAX requests?
JavaScipt Closures can be used for handling concurrent requests.
Question: How do you know that an AJAX request has completed?
If readyState's value is 4 means its completed.
Ajax Interview Questions
Following are some of the most frequently asked Ajax interview questions in the interview, here are the answers for them.
What are disadvantage of Ajax?
It does not crawl to search Engine.
Define JSON?
JSON is JavaScript Object Notation.
Describe how to handle concurrent AJAX requests?
JavaScipt Closures can be used for handling concurrent requests.
Source: Contents are provided by Technicalsymposium Google Group Members.
Disclaimer: All the above contents are provided by technicalsymposium.com Google Group members.
Further, this content is not intended to be used for commercial purpose. Technicalsymposium.com is not liable/responsible for any copyright issues.