Q1. What is Ajax?
Q2. What are Ajax applications?
Ans. Browser-based applications and platform-independent applications are used by Ajax.
Q3. 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
Q4. What are the Disadvantages of Ajax?
Ans. Following are the disadvantages of Ajax:
- c) Source code written in AJAX is easily human readable.
There will be some security issues in Ajax.
- d) Debugging is difficult
- e) Increases size of the requests
- f) Slow and unreliable network connection.
- g) Problem with browser back button when using AJAX enabled pages.
Q5. What are all the technologies used by Ajax?
Ans. AJAX uses following technologies:
- b) XMLHttpRequest
- c) Document Object Model (DOM)
- d) Extensible HTML (XHTML)
- e) Cascading Style Sheets (CSS)
- AJAX sends a request to the server and does not wait for the response. It performs other operations on the page during that time
- AJAX does not require the page to refresh for downloading the whole page
- AJAX minimizes the overload on the server since the script needs to request once
Q7. How can we cancel the XMLHttpRequest in AJAX?
Ans. Abort() method can be called to cancel the XMLHttpRequest in Ajax.
Q8. Is AJAX code cross browser compatible?
Q9. What is the name of the object used for AJAX request?
Ans. XmlHttpRequest object is used for Ajax requests.
Q10. What is an Event Handler?
Ans. An event handler will run a function when something happens, for example, a keystroke or movement of a mouse.
Q11. What Is the Format of an AJAX Request?
An AJAX request can be in any format:
- Text File
- JSON object
- What is XHR and What is it used for?
XHR stands for XMLHttpRequest. XHR objects, or XMLHttpRequest objects, are used in the following ways:
- The XHR object allows a client-side script to perform an HTTP request.
- AJAX applications use the XHR object so that the browser can communicate with the
- Server without requiring a post-back or refresh of the entire page.
Note: Old versions of Internet Explorer (6 and earlier) used MSXML ActiveX instead of XHR to provide this functionality.
Q13. What Is JSON?
Q14. When Should We Avoid Using AJAX?
- When do we want to create a secure application?
- When we want our WebPages to be visible to major search engines like Google, Yahoo, and Bing
- Why is AJAX a Problem for Visibility in Search Engines?
- Does an AJAX Request Work on Different Domains?
Ans. No. An AJAX request works only within the same domain.
- 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.
- Is AJAX Code Cross-Browser Compatible?
- What Are the Reasons for the Types of Errors Shown Below?
- XMLHttpRequest cannot load file:///C:/Tutorials/jQuery/practices/ajax/dataFile.txt. Cross origin requests are only supported for HTTP.
- Uncaught NetworkError: A network error occurred. An AJAX request cannot be executed without the server. To get a reply, we need to execute the AJAX request into the server. So, if the requested object is missing in the server, the above error could result.
Q20. How Do You Retrieve the State of the Requested Process?
Ans. By using the property “readyState” of XMLHttpRequest object (XHR Object), which uses numeric values to represent the state.
Q21. What does it mean if ReadyState has the Value 0?
Ans. A readyState of 0 means the request hasn’t been sent yet.
Q22. What does it mean if ReadyState has the Value 4?
Ans. A readyState of 4 means the request has seen sent and received.
Q23. What is the Meaning of 404 or 500 Status in AJAX?
Ans. It means that the AJAX call to the server is unsuccessful.