Ajax Interview Questions and Answers
Question - 61 : - How can we cancel the XMLHttpRequest in AJAX?
Answer - 61 : -
Abort() method can be called to cancel the XMLHttpRequest in Ajax.
Question - 62 : - Is AJAX code cross browser compatible?
Answer - 62 : -
No, it is supporting cross browser compatible. If the browsers supports native XMLHttpRequest JavaScript object, then this can be used.
Question - 63 : - What is the name of object used for AJAX request?
Answer - 63 : -
XmlHttpRequest object is used for Ajax requests.
Question - 64 : - What is prerequisite for Update Panel in Ajax?
Answer - 64 : -
Script Manager is pre-requisite to use Update Panel controls.
Question - 65 : - How many update panel can be used per page?
Answer - 65 : -
There are no restrictions on the number of update panels per page.
Question - 66 : - What is Script Manager?
Answer - 66 : -
Script Manager helps manage the client side script of AJAX. Script Manager acts as a mediator as AJAX depends on JavaScript. Every page that uses AJAX has a Script Manager to enable AJAX libraries.
Question - 67 : - How Ajax objects can be created?
Answer - 67 : -
Following syntax can be used to create Ajax objects:
Var sample = New ajaxObject('path of the page')
Question - 68 : - What are the protocols used by Ajax?
Answer - 68 : -
- HTTP’s GET or POST
- XMLHttpRequest for placing a request with the web server
- Uses JSON to communicate between the client and server
- UED or URL encoded data
Question - 69 : - What are all the security issues of Ajax?
Answer - 69 : -
Security issues that can be encountered
- When Ajax calls are sent through plain text and it may lead to know the database details
- Inserting scripts can also be possible and attackers can easily penetrate into the system
Question - 70 : - How can we handle concurrent requests?
Answer - 70 : -
Javascript functions should be written to handle concurrent requests and call back function can be passed as a parameter. Those parameters are passed to AjaxInteraction(URL, callback) object.