1) What is AJAX?
AJAX (Asynchronous JavaScript and XML) create better, faster and interactive web-apps. It provides data transfer between web-server and browser.
2) List some advantages of AJAX
Advantages are:
- More Interactive: Very quick in response.
- Bandwidth Utilization: When some data is fetched from some page it saves memory.
- Fast Retrieval of data: User is not blocked until the data is retrieved from server.
3) List some disadvantages of AJAX
Disadvantages are:
- Network Connection is slow and unreliable.
- Debugging of code is difficult.
- It is dependent on JavaScript.
4) Enlist some Web Application running on AJAX.
- Google
- Facebook
- YouTube
- Gmail
- Twitter
5) What are security issues with AJAX?
- We can view AJAX source code.
- Script can be embedded into the system.
6) Describe Synchronous and Asynchronous request in AJAX?
Synchronous Request- In this browser is not unresponsive but blocks the client until operation is complete. JavaScript engine is blocked of the browser.
Asynchronous Request-In this browser is responsive i.e. does not block the client. JavaScript engine in not blocked which allows user to perform different task as whole page is not refreshed.
7) Enlist technologies used by AJAX.
- JavaScript
- CSS
- DOM
- XHTML
- XMLHttpRequest
8) What is XMLHttpRequest?
It is an API for JavaScript where the HTTP/HTTPS request is send to the web server and load its response into script.
9) Write different types of property of XMLHttpRequest?
- onReadyStateChange
- readyState
- responseText
- responseXML
10) Enlist all method of XMLHttpRequest.
- open()
- send()
- setRequestHeader()
11) Describe JSON in AJAX?
JSON (JavaScript Object Notation) in JavaScript it is secure and reliable data exchange format which is easy to understand for both user and machine.
12) Enlist tool for debugging in AJAX.
- APTANA- IDE is free, open source, cross platform.
- Firebug- for Mozilla Firefox
- Fiddler- for Internet Explorer
- MyEclipse AJAX Tool
- Script Debugger
13) What are the types of post back in AJAX?
Post Back is of 2 types
- Synchronous Post Back
- Asynchronous Post Back
14) Write all the ready state of a request in AJAX?
- 0 means UNOPENED.
- 1 means OPENED.
- 2 mean HEADERS_RECEIVED.
- 3 mean LOADING.
- 4 means DONE.
15) List some AJAX Frameworks.
- jQuery
- MOO Tools
- Prototype
- YUI Library
- AngularJS
- Google Web Tool Kit
16) How can we test AJAX Code?
We can test the code by using open source unit testing framework i.e. JsUnit.
17) Give all controls of Ajax.
- Pointer
- ScriptManager
- ScriptManagerProxy
- Timer
- UpdatePanel
- UpdateProgress
18) Give methods for cross domain AJAX call.
There are 2 methods
- CORS (Cross Origin Resource Sharing)
- JSONP (JavaScript Object Notation with Padding)
19) How to handle concurrent request in AJAX?
We handle concurrent request with the object AjaxInteraction(URL,callback) where JavaScript function is designed. It is designed in such a manner that it can handle concurrent request and call back function.
20) Give the difference between Proxied and Proxyless Call.
Proxied Call- We call through stub objects which can be call through PHP classes.
Proxyless Call- We call through utility javascript function such as HTML_AJAX.replace() and HTML_AJAX.append().
21) Define Extender Controls in AJAX?
Extender Controls are used to enhanced the capabilities of ASP.NET. It uses block of JavaScript to add new and enhanced capabilities.
22) What is Script Manager?
Script Manager is used to manage the client side script. It is a mediator as AJAX depends on JavaScript.It is also used to enables AJAX libraries as every page that uses AJAX has Script Manager.
23) What are the protocols used by AJAX?
Protocols are as follows:
- 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
24) How to handle Exception Handling?
In AJAX we handle exception by
ErrorTemplatewhich is the child tag of script manager.
25) How many types of ready states in AJAX?
Types of ready states are as follows:
- Initialization
- Request
- Process
- Ready
26) Which request is better, GET or POST?
In AJAX HTTP GET request is more reliable as the data does not change for a given URL requested. HTTP POST should be used when state is updated on the server.
27) Can AJAX request be send to another domain?
No, in AJAX we cannot send AJAX request to another domain.
28) What values exists for the XmlHttpRequest.readyState field?
Ready State values are:
- Uninitialize: 0
- Loading: 1
- Loaded: 2
- Interactive: 3
- Complete: 4
29) How do we know that an AJAX request has completed?
AJAX request is completed when XmlHttpRequest.readyState has 4 value and XMLHttpRequest.Status is 200.
30) Define the role of the Update Panel?
Update Panel is used to add functionality to the existing ASP.NET applications. By using partial page rendering, it can be used to update the content.