technicalsymposium

Free Advertisement Procedure and Free Email /Whatsapp Updates

Free Email Alerts-Subscribe Below


Enter your Email ID here:

Note:Login & Check Your Email Inbox and Activate Confirmation Link

Technical Round Materials-AJAX-Free Download

Technical Round Materials-AJAX-Free Download

Brief about Ajax.

Ajax is considered to be a developer’s best friend because it offers several benefits to him such as updating the web page without reloading the entire page, requesting data from the server and also sending data to the server. AJAX is the acronym for Asynchronous JavaScript and XML. It is a new technique to communicate to and from a server/ database without completely refreshing the page. It creates faster, interactive, better web applications with help of CSS, XML, HTML, and JavaScript.

Differentiate between Synchronous and Asynchronous Ajax requests.

Synchronous Ajax requests – In this, the script stops and waits for the server to reply before continuing. In web application world, one has to happen after the other, i.e. the interaction between the customer and the server is synchronous. Synchronous is not recommended as it blocks/hangs the page until the response is received from the server.

Asynchronous Ajax requests handle the reply as and when it comes and allows the page to continue to be processed. Under Asynchronous, if there is any problem in the request it can be modified and recovered. The request doesn’t block the client as the browser is responsive. The user can perform other operations as well.

List some advantages and disadvantages of using Ajax.

Ajax is a very easy concept if one has a sound knowledge of JavaScript. It uses JavaScript functions to call methods from a web service. It has certain advantages-

· Speed- Ajax reduces the server traffic and also the time consumption on server and client side.

· Ajax is very responsive and fast, data can be transferred at a time.

· XMLHttpRequest plays a significant role in Ajax. It is a special JavaScript object that calls asynchronous HTTP request to the server for transferring data.

· One of the biggest advantages of using Ajax as forms are common elements in the web page. Ajax gives options for validation and much more.

· One doesn’t have to completely reload the page.

There are some disadvantages attached to Ajax. They are-

· Search engines would not be able to index Ajax applications so Ajax maybe a mistake.

· Anyone can have access to the code of Ajax and can view source it.

· ActiveX requests are enabled only in internet explorer and other new browsers.

What are different readyState in Ajax.

There are total 5 ready state in Ajax:

Value

State

Description

0

UNSET

Client has been created. Open() not yet called.

1

OPENED

Open() called.

2

HEADRERS_RECIEVED

Send() called and headers are available.

3

LOADING

Downloading: responseText holds partial data.

4

DONE

The operation is complete.

What is XMLHttpRequest object in Ajax? How can you XMLHttpRequest Object?

The XMLHttpRequest objects are used to exchange data with a server. It is an API whose methods transfer between a web browser and a web server. In XHR, it’s not necessary that data have to be in form of XML. It can be JSON or HTML. XHR can be used with protocols other than HTTP.

XMLHttpRequest is any developers kit because it has the option to update the page without reloading the entire page. You can request data from the server and also send data to the server in the background.

How to cancel the current request in Ajax?

Current request in AJAX is cancelled when the user performs an action which sets of an Ajax request. This can be depicted with the help of auto-complete functionality for a search box where users can be helped with related search terms based on their current input, by making an AJAX request each time they pass a key in search field. The user types faster than the Ajax request and you would want to abort any non-finished requests, before starting the next one.

How to send an Ajax request in JavaScript?

HTTP Requests are created with the help of XMLHttpRequest objects. It facilitates the transfer of data between client and server which happens via request and response. In XMLHttpRequest, you can perform the same function plus you can grab data from URL without having to refresh the page. AJAX lets you perform actions without reloading the entire page. The following steps tell how to call AJAX-

· Create an XMLHttpRequest object.

· Open the request with open method.

· Now, send the request with the send method.

Explain Fetch API in JavaScript.

Fetch API uses to request and response objects that can be used in future whenever needed. It provides an interface for fetching resources. Fetch API uses promises that enable cleaner API. Cache API or other similar things handles the request and responses that might require you to generate your own responses programmatically.

Thus, you can now crack your interview and work as a developer in one of your dream companies by preparing from these set of question and answers to be technically sound.

Explain limitations of Ajax.

1)Browser Integration

The dynamically created page does not register itself with the browser history engine, so triggering the “Back” function of the users’ browser might not bring the desired result.

2)Response-time Concerns

Network latency – or the interval between user request and server response – needs to be considered carefully during Ajax development.

3)Search Engine Optimization (SEO)

Websites that use Ajax to load data which should be indexed by search engines must be careful to provide equivalent Sitemaps data at a public, linked URL that the search engine can read, as search engines do not generally execute the JavaScript code required for Ajax functionality.

4)Reliance on JavaScript

Ajax relies on JavaScript, which is often implemented differently by different browsers or versions of a particular browser. Because of this, sites that use JavaScript may need to be tested in multiple browsers to check for compatibility issues.

Explain what is polling in AJAX.

The Process of retrieving data from a server to obtain near-live data regularly is called AJAX polling.

Brief about Ajax.

Ajax is considered to be a developer’s best friend because it offers several benefits to him such as updating the web page without reloading the entire page, requesting data from the server and also sending data to the server. AJAX is the acronym for Asynchronous JavaScript and XML. It is a new technique to communicate to and from a server/ database without completely refreshing the page. It creates faster, interactive, better web applications with help of CSS, XML, HTML, and JavaScript.

Differentiate between Synchronous and Asynchronous Ajax requests.

Synchronous Ajax requests – In this, the script stops and waits for the server to reply before continuing. In web application world, one has to happen after the other, i.e. the interaction between the customer and the server is synchronous. Synchronous is not recommended as it blocks/hangs the page until the response is received from the server.

Asynchronous Ajax requests handle the reply as and when it comes and allows the page to continue to be processed. Under Asynchronous, if there is any problem in the request it can be modified and recovered. The request doesn’t block the client as the browser is responsive. The user can perform other operations as well.

List some advantages and disadvantages of using Ajax.

Ajax is a very easy concept if one has a sound knowledge of JavaScript. It uses JavaScript functions to call methods from a web service. It has certain advantages-

· Speed- Ajax reduces the server traffic and also the time consumption on server and client side.

· Ajax is very responsive and fast, data can be transferred at a time.

· XMLHttpRequest plays a significant role in Ajax. It is a special JavaScript object that calls asynchronous HTTP request to the server for transferring data.

· One of the biggest advantages of using Ajax as forms are common elements in the web page. Ajax gives options for validation and much more.

· One doesn’t have to completely reload the page.

There are some disadvantages attached to Ajax. They are-

· Search engines would not be able to index Ajax applications so Ajax maybe a mistake.

· Anyone can have access to the code of Ajax and can view source it.

· ActiveX requests are enabled only in internet explorer and other new browsers.

What are different readyState in Ajax.

There are total 5 ready state in Ajax:

Value

State

Description

0

UNSET

Client has been created. Open() not yet called.

1

OPENED

Open() called.

2

HEADRERS_RECIEVED

Send() called and headers are available.

3

LOADING

Downloading: responseText holds partial data.

4

DONE

The operation is complete.

What is XMLHttpRequest object in Ajax? How can you XMLHttpRequest Object?

The XMLHttpRequest objects are used to exchange data with a server. It is an API whose methods transfer between a web browser and a web server. In XHR, it’s not necessary that data have to be in form of XML. It can be JSON or HTML. XHR can be used with protocols other than HTTP.

XMLHttpRequest is any developers kit because it has the option to update the page without reloading the entire page. You can request data from the server and also send data to the server in the background.

How to cancel the current request in Ajax?

Current request in AJAX is cancelled when the user performs an action which sets of an Ajax request. This can be depicted with the help of auto-complete functionality for a search box where users can be helped with related search terms based on their current input, by making an AJAX request each time they pass a key in search field. The user types faster than the Ajax request and you would want to abort any non-finished requests, before starting the next one.

How to send an Ajax request in JavaScript?

HTTP Requests are created with the help of XMLHttpRequest objects. It facilitates the transfer of data between client and server which happens via request and response. In XMLHttpRequest, you can perform the same function plus you can grab data from URL without having to refresh the page. AJAX lets you perform actions without reloading the entire page. The following steps tell how to call AJAX-

· Create an XMLHttpRequest object.

· Open the request with open method.

· Now, send the request with the send method.

Explain Fetch API in JavaScript.

Fetch API uses to request and response objects that can be used in future whenever needed. It provides an interface for fetching resources. Fetch API uses promises that enable cleaner API. Cache API or other similar things handles the request and responses that might require you to generate your own responses programmatically.

Thus, you can now crack your interview and work as a developer in one of your dream companies by preparing from these set of question and answers to be technically sound.

Explain limitations of Ajax.

1)Browser Integration

The dynamically created page does not register itself with the browser history engine, so triggering the “Back” function of the users’ browser might not bring the desired result.

2)Response-time Concerns

Network latency – or the interval between user request and server response – needs to be considered carefully during Ajax development.

3)Search Engine Optimization (SEO)

Websites that use Ajax to load data which should be indexed by search engines must be careful to provide equivalent Sitemaps data at a public, linked URL that the search engine can read, as search engines do not generally execute the JavaScript code required for Ajax functionality.

4)Reliance on JavaScript

Ajax relies on JavaScript, which is often implemented differently by different browsers or versions of a particular browser. Because of this, sites that use JavaScript may need to be tested in multiple browsers to check for compatibility issues.

Explain what is polling in AJAX.

The Process of retrieving data from a server to obtain near-live data regularly is called AJAX polling.

. What is Ajax?

Ajax is abbreviated as Asynchronous Javascript and XML. It is new technique used to create better, faster and more interactive web systems or applications. Ajax uses asynchronous data transfer between the Browser and the web server.

This technique is used to make internet faster and user friendly. It is not a programming language.

What are Ajax applications?

Browser based applications and platform independent applications are used by Ajax.

How many types of triggers are present in update panel?

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

What are all the controls of Ajax?

Following are the controls of Ajax:

· ScriptManager

· ScriptManagerProxy

· UpdatePanel

· UpdateProgress

· Timer

What is the name of the DLL that contains Ajax control tool kit?

Ajaxcontroltoolkit.dll is the DLL used for Ajax control tool kit and it can be downloaded from the internet. It can be added in the tool box or copied directly in the bin folder.

What role of #&& in querystring?

# is treated as fragment delimiter to delimit the history state and && precedes is used to check on the information in the query string.

How to control the duration of an Ajax request?

AsyncPostBackTimeout property is used to control the duration of Ajax request. Deafult value of this property is 90 seconds.


<asp:ScriptManager runat=”server” id=”sample” AsyncPostBackTimeout=”40”/>

What are the advantages of Ajax?

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?

Following are the disadvantages of Ajax:

1. AJAX is dependent on Javascript. If there is some Javascript problem with the browser or in the OS, Ajax will not support

2. Ajax can be problematic in Search engines as it uses Javascript for most of its parts.

3. Source code written in AJAX is easily human readable. There will be some security issues in Ajax.

4. Debugging is difficult

5. Increases size of the requests

6. Slow and unreliable network connection.

7. Problem with browser back button when using AJAX enabled pages.

What is update panel?


Update panel is a server control used to update the specified portion of a web page. Script Manager needs to be used whenever update panel is used. Using update panel, user cannot handle outside controls.

Which are the two methods used for cross domain Ajax calls?

There are two methods used to transfer data between the two more more security domains:

· CORS – Cross Origin Resource Sharing and it works with the HTTP web browsers

· JSONP – JSON with Padding which works with the HTTP GET and on legacy browsers

What are all the technologies used by Ajax?

AJAX uses following technologies:

· JavaScript

· XMLHttpRequest

· Document Object Model (DOM)

· Extensible HTML (XHTML)

· Cascading Style Sheets (CSS)

What are all the features of Ajax?

Following are the features of Ajax and they are as follows:

· Live data binding

· Client-side template rendering

· Declarative instantiation of client components

· Observer pattern on JavaScript objects and arrays

· Invoking ADO.NET data services and data contexts

· DataView control

What is JSON in Ajax?

JSON is abbreviated as JavaScript Object Notation.

JSON is a safe and reliable data interchange format in JavaScript, which is easy to understand for both users and machines.

What are the difference between AJAX and Javascript?

The differences between AJAX and JavaScript are as follows:

AJAX

Javascript

AJAX sends request to the server and does not wait for the response. It performs other operations on the page during that time

JavaScript make a request to the server and waits for response

AJAX does not require the page to refresh for downloading the whole page

JavaScript manages and controls a Web page after being downloaded

AJAX minimizes the overload on the server since the script needs to request once

JavaScript posts a request that updates the script every time

What are the components of the ASP.NET AJAX architecture?

There are two components of AJAX Architecture:

· AJAX client architecture

· AJAX server architecture

What are the extender controls?

The extender controls uses a block of JavaScript code to add new and enhanced capabilities to ASP.NET.

What is AJAX Control Extender Toolkit?

AJAX Control Toolkit is one of the extenders that are used to extend or add the functionalities of the ASP.NET controls. The extenders use a block of JavaScript code to add new and enhanced capabilities to the ASP.NET controls.

AJAX Control Extender Toolkit is a free download from site.

Where AJAX cannot be used?

Users cannot use AJAX if

· If Page need to show in a search engine

· If browser does not support JavaScript

· If user wants to create secure application

What are the pre-requisites to execute AJAX applications on a server?

AJAX is a built-in functionality of .NET Framework 4.0 and AJAX application can be executed by just installing Microsoft Visual Studio 2010. To use extenders in your applications, you are required to install AJAX Control Toolkit and copy the AjaxControlToolkit.dll file to the Bin directory of your application.

What is AJAX Framework?

ASP.NET AJAX is a free framework to implement Ajax in asp.net web applications. It is used to quickly creating efficient and interactive Web applications that work across all browsers.

How can you find out that an AJAX request has been completed?

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.

Is javascript knowledge is required to do Ajax?

Yes, if you plan to develop new AJAX functionality for your web application.

What are all the browsers support AJAX?

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?

JSUnit is the client side javascript code used as part of JUnit. JSUnit has been used for Ajax code.

Is Ajax said to be a technology platform or is it an architectural style?

Ajax supports both technology and as architectural style.

How can AJAX applications be debugged?

Two tools are used for debugging:

· Fiddler for IE

· Firebug for Mozilla.

How can we cancel the XMLHttpRequest in AJAX?

Abort() method can be called to cancel the XMLHttpRequest in Ajax.

Is AJAX code cross browser compatible?

No, it is supporting cross browser compatible. If the browsers supports native XMLHttpRequest JavaScript object, then this can be used.

What is the name of object used for AJAX request?

XmlHttpRequest object is used for Ajax requests.

What is prerequisite for Update Panel in Ajax ?

Script Manager is pre-requisite to use Update Panel controls.

How many update panel can be used per page?

There are no restrictions on the number of update panels per page.

What is Script Manager?

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.

How Ajax objects can be created?

Following syntax can be used to create Ajax objects:

Var sample = New ajaxObject(‘path of the page’)

What are the protocols used by Ajax?

· 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

What are all the security issues of Ajax?

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

How can we handle concurrent requests?

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.

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. Refresh can be made for the partial page instead of whole page.

Can we use nested update panel in Ajax?

Yes, we can use nested update panel in Ajax. Update panels can be nested to have more control over the Page Refresh.

What are the types of post back in Ajax?

There are two types of post backs:

· Synchronous Postback

· Asynchronous Postback

How can we handle exception handling in Ajax?

ErrorTemplate which is the child tag of Script Manager is used to handle exception handling in Ajax.

What are the components of the ASP.NET Ajax Client Library?

Following components are used in Ajax client library:

· Component Layer

· Core Services Layer

· Browser Compatibility Layer

What are the controls of the Script Management group?

The controls of script Management group are:

· ScriptManager

· ScriptManagerProxy

4. What are all the different data types that JSON supports?

JSON supports following data types:

· String

· Number

· Boolean

· Array

· Object

· Null

What are the goals of Ajax?

The basic goals of ASP.NET Ajax are:

· Reduced web server hits

· Reduced Network load

· Interactive user interface

· Platform and architecture neutrality

· Support for both synchronous and asynchronous communication

· Provide a server- and client-side framework

What is the difference between proxied and proxyless calls in AJAX?

Proxied calls are made through stub objects which can be called from PHP classes on the JavaScript side in AJAX.

Proxyless calls are made using utility JavaScript functions like HTML_AJAX.replace() and HTML_AJAX.append() in AJAX.

How many types of ready states in Ajax?

There are four ready states in Ajax:

· Initialization

· Request

· Process

· Ready

What is the difference between RegisterClientScriptBlock, RegisterClientScriptInclude and RegisterClientScriptResource?

Following are the functions:

· RegisterClientScriptBlock – The script is specified as a string parameter.

· RegisterClientScriptInclude – By setting the source attribute to a URL that point to a script file.

· RegisterClientScriptResource – specifies Resource name in an assembly. The source attribute is automatically populated with a URL by a call to an HTTP handler that retrieves the named script from the assembly.

Which request is better, Get or Post?

AJAX requests should use an HTTP GET request where the data does not change for a given URL requested.

An HTTP POST should be used when state is updated on the server. This is highly recommended for a consistent web application architecture.

What are the limitations of Ajax?

An Ajax Web Application tends to confuse end users if the network bandwidth is slow and there is no full postback running.

AJAX Interview Questions

A list of frequently asked AJAX interview questions and answers are given below.

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?


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.

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.

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.

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

What does XMLHttpRequest?

sends data in the background
receives data
updates data without reloading the page

What are the real web applications of AJAX currently running in the market?

Twitter
Facebook
Gmail
Javatpoint
Youtube etc.

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.

What are the properties of XMLHttpRequest?

The important properties of XMLHttpRequest object are given below.

onReadyStateChange

readyState

responseText

responseXML

What are the technologies used by AJAX?

HTML/XHTML and CSS

DOM

XML

XMLHttpRequest

JavaScript

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.

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

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.

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.

Which are limitations of AJAX?

- Back functionality can’t work because the dynamic pages won’t register themselves to the browsers cache. Hence the use Iframe will become required.
- The page cannot be bookmarked if it is developed using Ajax.
- If java script is not enabled, Ajax will stop working.
- Because different components of the pages are loaded at different times, response time may be slow.
- Because different components of the pages are loaded at different times it may create confusion for the user.

What is the difference between synchronous postback and asynchronous postback?

The difference between synchronous and asynchronous postback is as follows:

- Asynchronous postback renders only the part of the page which is needed; while, synchronous postback renders the entire page in a postback.
- Asynchronous postback executes only one postback at a time, that is, if you have two buttons doing asynchronous postback, the actions are executed one by one; while, - synchronous postback invoke all the actions at a time.
- Asynchronous postback only changes the update panel that invoke the postback; while, synchronous postback changes the entire page.

Why do we use the XMLHttpRequest object in AJAX?

- Javascript uses the XMLHttpRequest object to manipulate XML and other text data between client and server.
- AJAX applications use the XMLHttpRequest object to avoid the postback of entire page when the browser is communicating with server.
- The XMLHttpRequest object enables a client-side script to execute an HTTP request.
- For this functionality MSXML ActiveX component is used in earlier version of Internet Explorer. While, XMLHttpRequest is used in Internet Explorer 7 and other browsers, such as Mozilla, Firefox.

What are the new features included in the Microsoft AJAX library?

The new features included in the Microsoft AJAX library are as follows:

- Imperative syntax: AJAX library provide simple imperative syntax which is required to create and manage controls.
- Script loader: It is used to retrieve all scripts automatically which are required by one or more client component or control and executes them in the order in which they are received.
- Client data access: It’s used to access client data and display by client data control and client template.
- Client datacontext: It’s used to read and write the permission to data in a database.
- The AdoNetDataContext class - Supports to easily communicate to an ADO.NET Data Services service.

What are the new features of ASP.NET AJAX 4.0?

These features are as follows:

- It enables the application to bind the live data.
- It enables to render the client-side template.
- It enables declarative instantiation of client components.
- It provides observer pattern on JavaScript objects and arrays.
- It provides the facility to invoke ADO.NET data services and data contexts.
- It supports for the DataView control.

How many validation controls are supported in ASP.NET AJAX 4.0?

The following validation controls are supported in ASP.NET AJAX 4.0:

- FilteredTextBoxExtender : This validation is used to apply filtering to a text box.
- MaskedEditExtender and MaskedEditValidator : These validation controls are used to prevent a user to enter only a particular pattern of characters in the TextBox.
- ValidatorCalloutExtender : This validation is used to display a balloon tooltip containing the error message by attaching the ASP.NET validators.
- NoBot : It restricts the input forms automatically to be filled by spam/bot and used to ensure that the user is not a computer machine by the automated Public Turing test.
- PasswordStrengthExtender : It is used to find the strength of the password entered in the text box by checking the different strength related parameters.

What are the differences between AJAX and JavaScript?

The differences between AJAX and JavaScript are given as follows:

- AJAX sends request to the server and will not wait for the response.
- It will allow other operations on the page before it get response of previous request; whereas, JavaScript make a request to the server, will waits for response and will not allow other operation on the page during that time.
- In AJAX, the page will not get refreshed for downloading the whole page while JavaScript manages and controls a Web page after being downloaded.
- By using AJAX we can minimize the overload on the server because the script needs to request once while JavaScript posts the request that updates the script each time.

List the different states of XMLHttpRequest with their description.

The different states of the XMLHttpRequest object are as follows:

1) Uninitialized : It is the state in which the object has not been initialized.
2) Open: It is the state when the object has been created but the send function is not invoked.
3) Sent: It is the state when the send function is invoked but the status and headers are not available.
4) Receiving: It is the state when the data is received by the process.
5) Loaded: It is the state when the procedure is completed and the data is available.

Describe the AccordionExtender control.

- The AccordionExtender control is almost same as the CollapsiblePanelExtender control.
- It enables the grouping of multiple collapsible panels in a single control.
- It also manages the collapsed and expanded state of every panel and one panel will expand at a time.
- Using AccordionExtender control we can’t expand two or more panels at a time.

However, we can click the header templates of particular panel to display the hidden contents.

By default, one panel is always expanded in theAccordionExtender.

How do I provide internationalized AJAX interactions?

To provide internationalized AJAX components you need to do the following:

Set the charset of a page to an encoding which is provided by the target languages. The following meta declaration in your HTML/JSP page is used to set the content type:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

In the page JavaScript ensure that the encoding of any parameters sent to the server is done. To achieve this JavaScript has the escape() function which will give Unicode escape strings containing localized text in hexadecimal format.

In the server side component set the character encoding using the HttpServletRequest.setCharacterEncoding() method. Before accessing the localized parameter with HttpServletRequest.getParameter() call. In the case of UTF this will be request.setCharactherEncoding("UTF-8");.

A server-side component returning AJAX responses requires to set the encoding of the response to the similar encoding used in the page.

response.setContentType("text/xml;charset=;UTF-8");
response.getWriter().write(" <response>Not valid </response>");

How do I submit a form or a part of a form without a page refresh?

When creating a form ensure that in the "form" element "onSubmit" attribute calls the JavaScript function that returns false.

<form onSubmit="doSubmit();return false;" >
<input type="text" id="myinput" /><input type="submit" id="btnSubmit" value="Save"/>
</form>

The other way is to associate a function with a form button in a similar way.

<form onSubmit="doSubmit();return false;" >
<input type="text" id="myinput" />
<input type="button" id="button1" onClick="doSubmit()" value="Save"/>
</form>

While you update the page it is recommended that you should wait to confirm that the AJAX update of the form data was successful before updating the data in your page. Otherwise, it is possible that the data is not updated properly and the user is not aware about it. It is suggested to display a loading message message when doing a partial update and after the successful AJAX interaction we can update the page.

How do I create a thread to do AJAX polling?

JavaScript does not provide threads. JavaScript functions are called after an event occurred on a page like the page is loaded, a mouse click, or a form element get focused.

You can make a timer by using the setTimeout which requires a function name and time in milliseconds as its arguments.

Calling the same function using loop which is given in the JavaScript example below.

function checkForMsg() {
// start AJAX interaction with handleCallback as the callback function
}

// callback for the request
function handleCallback() {

// do post processing
setTimeout("checkForMsg()", 20000);
}

Note that the checkForMessage will continue to loop infinitely. You may want to change the increment interval based on activity. You may also want to change the logic which will break the loop based on some AJAX response executing condition.

Describe the formats and protocols used by AJAX

- The client web page is creates the XmlHttpRequest, and thus the connection from the web page to an application on the server.
- Part of that connection determines how the response can be produced to the client code – via the use of a “callback” routine.
- The callback routine is called multiple times which come with a status code which indicates the reason for the invocation.
- When a request can be successfully completed by the server application, a response should also be produced.

Are there security issues with AJAX?

- JavaScript is in plain view to the user with by selecting view source of the page. JavaScript cannot access the local file system without the user's permission.
- An AJAX interaction can only be achieved with the servers-side component from which the page is loaded.
- A proxy pattern can be used for AJAX interactions with external services.
- We should take care that the application model is not exposed in such a way that our server-side components are at risk if a user to reverse engineer your application.
- Like any other web application we should use HTTPS to secure the connection when sensitive information is being exchanged.

What are Difference between Server-Side AJAX framework and Client-side AJAX framework?

- The server-side framework facilitates the developers to develop Ajax functionality, without gaining much knowledge of JavaScript.
- This framework supports server controls and components as well as the drag and drop features.
- This framework is usually preferred when you required to rapidly ajaxify an asp.net web page. The drawback is that a round trip will take place to the server to execute a client-side action.
- The Client-Side Framework allows you to build web applications with rich user-interactivity as that of a desktop application.
- It includes a set of JavaScript libraries, which is not dependent from ASP.NET. The functionalities of this library are enhanced in every release.

If there is an input in the text field what are all the functions which get executed?

We can execute following functions when there is an input in the text field.

1) Defines the url that we will sent to the server
2) A parameter is inserted to the input field’s content.
3) A parameter is inserted to restrict the server from the cache.
4) When a change is triggered statechange is invoked.
5) An XMLHTTP object having a given URL gets invoked
6) A request is sent to the server through HTTP.

What is an UpdatePanel Control?

An UpdatePanel control is a cover for server side controls which is to be partial postbacked on ajax enabled page.

All controls included in the UpdatePanel will be partial postbacked. Below is a small example of using an UpdatePanel.

<asp:ScriptManager runat=”server”>
</ asp:ScriptManager>
<asp:UpdatePanel runat=”server”>
<ContentTemplate>
<asp:Button runat=”server”></asp:Button>
</ContentTemplate>
</asp:UpdatePanel>

On clicking the button the page will be updated partially. There won’t be a full postback by the web page.

In this way the content beyond the update panel won’t be posted back to the server.

The contents in the updatepanel will be refreshed only.

How does one call a JavaScript function from the AJAX code?

- Ajax is a form of JavaScript, which uses XML Http Request objects which pass action event parameters to a method named “open”.
- In AJAX we can’t track the requests and responses in any order.
- ”XMLHttpRequest.open” is the function which uses action events as Parameters in URL.
- While “XMLHttp Request.send” sends the Request object either synchronously or asynchronously which depend on whether the option for the synchronous version is true or false.

Which is the purpose for using the ScriptManager?

The purposes of ScriptManager in ASP.NET AJAX are explained as following.

- It enables the Client-script functionality of the Microsoft AJAX Library and it also supports a custom script that we can send to the browser.
- It supports Partial-page rendering, which enable us to make partial page update without a postback.
- The ASP.NET AJAX UpdatePanel, Timer and UpdateProgress controls work with ScriptManager control to support partial-page rendering.
- It supports JavaScript proxy classes for Web services that provide client script which enable us to access Web services by exposing them as strongly typed objects.
- It provides JavaScript classes to deal with ASP.NET authentication and profile application services.

Which are the major ASP.NET Ajax Server Controls?

- Timer: This control is used to refresh the contents of a web page at already specified intervals of time.
- Script Manager: This is the heart of an AJAX enabled web page. To develop the partial page rendering, it is necessary to set the EnablePartialRendering property of the ScriptManager control to true.
- ScriptManagerProxy: A ScriptManagerProxy control passes references to a ScriptManager control in a master page to declare the Ajax behavior.
- UpdateProgress: This control is required to display the progress when an update action in partial page rendering process is in progress.
- UpdatePanel : Update panel is required to create partial page updates in an Ajax enabled web page. All the controls which we need to involve in partial page update we need to include them inside an UpdatePanel control.

AJAX and problem it solve

Ajax: It is a short for Asynchronous JavaScript and XML. It solves the problem of unnecessary data transfers and allows asynchronous processing and avoids unnecessary processing to be done by server.

What are the benefits of AJAX over Java applet?

What are the benefits of AJAX over Java applet? - The following are the benefits of AJAX over Java applet:

< What is the disadvantage of AJAX?

Data is stored at the client side so crucial and confidential data should not be stored to avoid any kind of security issues

What is AJAX?

In one sense, AJAX is simply an acronym for “Asynchronous JavaScript And XML” In another, it is a protocol for sending requests from a client (web page) to a server, and how the information is / should be communicated between the client and the server

Is AJAX a programming language?

No

How new is AJAX?

The terminology is new, but the techniques are not.

When can/should AJAX be used?

AJAX is best suited for small (hopefully unobtrusive) updates to the current web page, based on information that is not available until it has been provided by the end user.

Describe the formats and protocols used/specified by AJAX

The client web page is responsible for creating the XmlHttpRequest, and therefore the connection from the web page to some application on the server.

Part of this connection identifies how the response can / should be provided to the client code – via the use of a “callback” routine.

The callback routine is invoked multiple times with a status code, indicating the reason for the invocation.

If the request can be successfully completed by the server application, a response should also be provided.

Describe the formats and protocols used/specified by AJAX

The client web page is responsible for creating the XmlHttpRequest, and therefore the connection from the web page to some application on the server. Part of this connection identifies how the response can / should be provided to the client code – via the use of a “callback” routine. The callback routine is invoked multiple times with a status code, indicating the reason for the invocation. If the request can be successfully completed by the server application, a response should also be provided.

Describe some things that can’t be done with AJAX

Sending a request to a server outside of the domain from which the web page originated.

How should AJAX objects be created?

In a browser general manner, if at all possible.

For what error conditions should programs check?

The connection cannot be established. The request does not complete in a timely fashion or Unexpected response

Is Adaptive Path selling Ajax components or trademarking the name? Where can I download it?

Ajax isn’t something you can download. It’s an approach — a way of thinking about the architecture of web applications using certain technologies. Neither the Ajax name nor the approach are proprietary to Adaptive Path.

Is Ajax just another name for XMLHttpRequest?

No. XMLHttpRequest is only part of the Ajax equation. XMLHttpRequest is the technical component that makes the asynchronous server communication possible; Ajax is our name for the overall approach described in the article, which relies not only on XMLHttpRequest, but on CSS, DOM, and other technologies.

Why did you feel the need to give this a name?

I needed something shorter than “Asynchronous JavaScript+CSS+DOM+XMLHttpRequest” to use when discussing this approach with clients.

Techniques for asynchronous server communication have been around for years. What makes Ajax a “new” approach?

What’s new is the prominent use of these techniques in real-world applications to change the fundamental interaction model of the Web. Ajax is taking hold now because these technologies and the industry’s understanding of how to deploy them most effectively have taken time to develop.

Is Ajax a technology platform or is it an architectural style?

It’s both. Ajax is a set of technologies being used together in a particular way.

What kinds of applications is Ajax best suited for?

We don’t know yet. Because this is a relatively new approach, our understanding of where Ajax can best be applied is still in its infancy. Sometimes the traditional web application model is the most appropriate solution to a problem.

Does this mean Adaptive Path is anti-Flash?

Not at all. Macromedia is an Adaptive Path client, and we’ve long been supporters of Flash technology. As Ajax matures, we expect that sometimes Ajax will be the better solution to a particular problem, and sometimes Flash will be the better solution. We’re also interested in exploring ways the technologies can be mixed (as in the case of Flickr, which uses both).

Does Ajax have significant accessibility or browser compatibility limitations? Do Ajax applications break the back button? Is Ajax compatible with REST? Are there security considerations with Ajax development? Can Ajax applications be made to work for users who have JavaScript turned off?

The answer to all of these questions is “maybe”. Many developers are already working on ways to address these concerns. We think there’s more work to be done to determine all the limitations of Ajax, and we expect the Ajax development community to uncover more issues like these along the way.

Some of the Google examples you cite don’t use XML at all. Do I have to use XML and/or XSLT in an Ajax application?

No. XML is the most fully-developed means of getting data in and out of an Ajax client, but there’s no reason you couldn’t accomplish the same effects using a technology like JavaScript Object Notation or any similar means of structuring data for interchange.

Are Ajax applications easier to develop than traditional web applications?

Not necessarily. Ajax applications inevitably involve running complex JavaScript code on the client. Making that complex code efficient and bug-free is not a task to be taken lightly, and better development tools and frameworks will be needed to help us meet that challenge.

Do Ajax applications always deliver a better experience than traditional web applications?

Not necessarily. Ajax gives interaction designers more flexibility. However, the more power we have, the more caution we must use in exercising it. We must be careful to use Ajax to enhance the user experience of our applications, not degrade it.

Are Finite State Machines (FSM’s) appropriate for use with AJAX?

Possibly There are circumstances under which an FSM might be appropriate. It depends upon the complexity of the environment, and the number of machines that might need to be contacted in order to obtain the response to the request.

Identify and describe the state transitions that can/should occur within a transaction

Reset : When the XmlHttpRequest object is created, no connection yet exists between the clent, and the server.

Open : When the xmlHttp.open() is issued, the request is being prepared for transmission to the server

Sent : When the xmlHttp.send() is issued, the request is transmitted to the server application

Rcvd : When the xmlHttp callback routine is called, the readyState and status fields of the object define why the routine was called

What values exists for the XmlHttpRequest.readyState field, and what do they mean?

readyState values:

0 = uninitialized

1 = loading

2 = loaded

3 = interactive

4 = complete

When is it appropriate to access, or use the other fields within the XmlHttpRequest object?

The most important field is the readyState field. Once a value of 4 (i.e., complete) is received,then the next most important field is status. The value of status will be the same as the HTTP Status Code values

When should AJAX NOT be used?

It would not be appropriate to use AJAX when the “answer/result” can be determinded by the client. Generally, the purpose of AJAX is to submit a short request to the server, and process the response in such a way as to add value to the currently displayed page.It would also not be appropriate to use AJAX when the magnitude of the response is such that it would be easier, and more clear to redisplay the page.

What objects are used by AJAX programs?

The most obvious / correct answer would be “XmlHttpRequest”. However, personally, I would seriously consider someone who discussed the use of the callback routine, and most specifically “the response” as “objects”.

What does AJAX stand for and who coined the phrase?

“Advanced JavaScript And XML”, coined by Jesse James Garret, Adaptive Path – http://adaptivepath.com/publications/essays/archives/000385.php

What Javascript object is used to drive AJAX requests, and how does it differ on various browser?s

XmlHttpRequest. It’s an ActiveX object on IE, but is a native object on the other browsers (Firefox, Mozilla, Opera, Safari, Konqueror)

How do you know that an AJAX request has completed?

The XHR.readyState is 4 and the XHR.status is 200 (or zero if the request is to a local file). The callback function is called four times – first with status=1, then 2,3, and finally 4.

How does XML processing differ on the different browsers?

It’s an ActiveX object on IE, but is native on the other browsers

Is it possible to achieve similar results without the XmlHttpRequest object?

A hidden IFrame (actually an IFrame of size 0px * 0px due to a bug in IE) can be used to retrieve data, and its contents can then be processed in a similar manner to the response from an XHR call.

Did Adaptive Path invent Ajax? Did Google? Did Adaptive Path help build Google’s Ajax applications?

Neither Adaptive Path nor Google invented Ajax. Google’s recent products are simply the highest-profile examples of Ajax applications. Adaptive Path was not involved in the development of Google’s Ajax applications, but we have been doing Ajax work for some of our other clients.

Is it possible to set session variables from javascript?

It’s not possible to set any session variables directly from javascript as it is purely a client side technology. You can use AJAX though to asyncronously.

What do I need to know to create my own AJAX functionality?

If you plan not to reuse and existing AJAX component here are some of the things you will need to know.

Plan to learn Dynamic HTML (DHTML), the technology that is the foundation for AJAX. DHTML enables browser-base realtime interaction between a user and a web page. DHTML is the combination of JavaScript, the Document Object Model (DOM) and Cascading Style Sheets (CSS).

* JavaScript – JavaScript is a loosely typed object based scripting language supported by all major browsers and essential for AJAX interactions. JavaScript in a page is called when an event in a page occurs such as a page load, a mouse click, or a key press in a form element.

* DOM – An API for accessing and manipulating structured documents. In most cases DOM represent the structure of XML and HTML documents.

* CSS – Allows you to define the presentation of a page such as fonts, colors, sizes, and positioning. CSS allow for a clear separation of the presentation from the content and may be changed programmatically by JavaScript.

Understanding the basic request/response nature of HTTP is also important. Many subtle bugs can result if you ignore the differences between the GET and POST methods when configuring an XMLHttpRequest and HTTP response codes when processing callbacks.

JavaScript is the client-side glue, in a sense. JavaScript is used to create the XMLHttpRequest Object and trigger the asynchronous call. JavaScript is used to parse the returned content. JavaScript is used to analyze the returned data and process returned messages. JavaScript is used to inject the new content into the HTML using the DOM API and to modify the CSS.

Is Ajax just another name for XMLHttpRequest?

No. XMLHttpRequest is only part of the Ajax equation. XMLHttpRequest is the technical component that makes the asynchronous server communication possible; Ajax is our name for the overall approach described in the article, which relies not only on XMLHttpRequest, but on CSS, DOM, and other technologies.

Can Ajax be used with Microsoft’s .NET?

See http://ajax.schwarz-interactive.de/ for a free AJAX implementation for the .NET Framework.

Can we use HTTP GET or POST for AJAX calls?

AJAX requests should use an HTTP GET request when retrieving data where the data will not change for a given request URL. An HTTP POST should be used when state is updated on the server. This is in line with HTTP idempotency recommendations and is highly recommended for a consistent web application architecture.

How can you submit a form or a part of a form without a page refresh?

When creating a form make sure that the “form” element “onSubmit” attribute is set to a JavaScript function that returns false.

<form onSubmit=”doAJAXSubmit();return false;” >

<input type=”text” id=”tf1? />

<input type=”submit” id=”submit1? value=”Update”/>

</>

You can also submit data by associating a function with a form button in a similar way.

<form onSubmit=”doAJAXSubmit();return false;” >

<input type=”text” id=”tf1? />

<input type=”button” id=”button1? onClick=”doAJAXSubmit()” value=”Update”/>

</>

Note that the form “onSubmit” attribute is still set. If the user hits the enter key in the text field the form will be submitted so you still need to handle that case. When updating the page it is recommend you wait to make sure that the AJAX update of the form data was successful before updating the data in the page. Otherwise, the data may not properly update and the user may not know. I like to provide an informative message when doing a partial update and upon a successful AJAX interaction I will then update the page.

Where do you find AJAX used heavily in the internet and who is investin in AJAX ?

Google is making a huge investment in developing the Ajax approach. All of the major products Google has introduced over the last year — Orkut, Gmail, the latest beta version of Google Groups, Google Suggest, and Google Maps — are Ajax applications. (For more on the technical nuts and bolts of these Ajax implementations, check out these excellent analyses of Gmail, Google Suggest, and Google Maps.) Others are following suit: many of the features that people love in Flickr depend on Ajax, and Amazon’s A9.com search engine applies similar techniques.These projects demonstrate that Ajax is not only technically sound, but also practical for real-world applications. This isn’t another technology that only works in a laboratory. And Ajax applications can be any size, from the very simple, single-function Google Suggest to the very complex and sophisticated Google Maps.And because there are so many developers out there who already know how to use these technologies, we expect to see many more organizations following Google’s lead in reaping the competitive advantage Ajax provides.

Why does HTML_AJAX hang on some server installs?

If you run into an HTML_AJAX problem only on some servers, chances are your running into a problem with output compression. If the output compression is handled in the PHP config we detect that and do the right thing, but if its done from an apache extension we have no way of knowing its going to compress the body. Some times setting HTML_AJAX::sendContentLength to false fixes the problem, but in other cases you will need to disabled the extension for the AJAX pages.We have also seen problems caused by debugging extensions like XDebug, disabling the extension on the server page usually fixes that. Problems dealing with Using HTML_AJAX, and general JavaScript development

Will HTML_AJAX integrate with other Javascript AJAX libraries such as scriptaculous?

HTML_AJAX doesn&#039;t have specific plans to integrate with other JavaScript libraries. Part of this is because external dependencies make for a more complicated installation process. It might make sense to offer some optional dependencies on a library like scriptaculous automatically using its visual effects for the loading box or something, but there is not a lot to gain from making default visuals like that flashier since they are designed to be easily replaceable.

What are the advantages of Ajax ?

The related pages on a website consist of much content that is common between them. Using traditional methods, that content would have to be reloaded on every request. However, using Ajax, a web application can request only the content that needs to be updated, thus drastically reducing bandwidth usage and load time. The use of asynchronous requests allows the client’s Web browser UI to be more interactive and to respond quickly to inputs, and sections of pages can also be reloaded individually. Users may perceive the application to be faster or more responsive, even if the application has not changed on the server side. The use of Ajax can reduce connections to the server, since scripts and style sheets only have to be requested once.

Will my server-side framework provide me with AJAX?

Most of the existing Java based frameworks already have some level of AJAX interactions and new frameworks and component libraries are being developed to provide better AJAX support. There are a lot and you can find a good list at www.ajaxpatterns.org/Java_Ajax_Frameworks. If you have not chosen a framework yet it is recommended you consider using JavaServer Faces or a JavaServer Faces based framework. JavaServer Faces components can be created and used to abstract many of the details of generating JavaScript, AJAX interactions, and DHTML processing and thus enable simple AJAX used by JSF application developer and as plug-ins in JSF compatible IDEs, such as Sun Java Studio Creator.

What is AJAX?

1. AJAX is an acronym for Asynchronous JavaScript and XML.

2. AJAX is a new technique for creating better, faster, and more interactive web applications.

3. With AJAX, a JavaScript script can communicate directly with the server, with the XMLHttpRequest object. With this object, a JavaScript can exchange data with a web server, without reloading the page.

4. AJAX uses asynchronous data transfer (HTTP requests) between the browser and the web server, allowing web pages to request small bits of information from the server instead of entire pages.

5. The AJAX technique makes Internet applications smaller, faster and more user-friendly.

What is "AsyncPostBackTimeout" Property?

1. AsyncPostBackTimeout Property specifies the time, in seconds, before an asynchronous postback timeout occurs if no response is received from the server.

2. The default value of this property is 90 (seconds).

3. We can also set the user defined error message using "asyncpostbackerrormessage" property (as shown in the code above) for the time out.

4. For example:

<asp:ScriptManager ID="scriptManager1" runat="server" AsyncPostBackErrorMessage="We can not serve your request at this moment. Please try later." AsyncPostBackTimeout="120">

</asp:ScriptManager>

How to use Script Manager's "AsyncPostBackTimeout" at runtime?

1. If you have a Script Manager on the Master page and need to exceed AsyncPostBackTimeout only on specific page, then

2. Add this code line to the "Page_Load" event of your page.

3. This will set the AsyncPostBackTimeout to 2 minutes.

4. For example:

ScriptManager _scriptMan = ScriptManager.GetCurrent(this);

_scriptMan.AsyncPostBackTimeout = 120;

OR

ScriptManager.GetCurrent(this).AsyncPostBackTimeout = 120;

Is it possible to use a "FileUpload" control within the update panel?

1. Yes, it's possible.

2. But we need to use Postback triggers to upload the file.

Can you list some AJAX controls?

1. ScriptManager

2. ScriptManagerProxy

3. Timer

4. UpdatePanel

5. UpdateProgress

What is the "DisplayAfter" property in the UpdateProgress control?

1. The Displayafter property specifies how many seconds after loading the image that it needs to be displayed in the AJAX postback.

2. In other words, it gets or sets the value in milliseconds before the UpdateProgress control is displayed.

3. For example:

In the following example, the "Loading" text will be displayed after 5 sec.

<asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="5000"

AssociatedUpdatePanelID="UpdatePanel1">

<ProgressTemplate>

Loading...

</ProgressTemplate>

</asp:UpdateProgress>

How can we detect asynchronous partial page postbacks?

1. Use the "IsInAsyncPostBack" property of the "ScriptManager".

2. It returns a boolean value that can be used to check for partial page postbacks.

Which two methods are used for handling Cross-Domain AJAX Calls?

1. Cross-domain means the ability to manually or automatically access or transfer data between two or more differing security domains.

2. Cross-Origin Resource Sharing (CROS): Works with all HTTP verbs and most modern web browsers. Provides better support for error handling than JSONP.

3. JSON with padding (JSONP): It only works with HTTP GET verb and on legacy browsers.

What is the limitation with update panel?

1. Using update panel, you cannot validate outside controls.

2. For example:

There is a grid in an update panel and you want to validate the grid's field having a button outside the update panel. Validation will be executed but does not affect the page due to the update panel. So to solve this kind of problem, we have placed a button in another update panel.

What is "PageMethod" in ASP.Net AJAX?

1. The "PageMethods" feature enables the use of code-behind page methods on the client side.

2. PageMethods are implemented in a code behind file.

3. These are public static methods and are annoted with a [WebMethod] attribute.

4. The PageMethods can only be added to the page itself so don't try to add them to user controls or custom controls, it won't work.

5. Basically, all you need to do in order to use a PageMethod is to decorate your page method with the ScriptMethod and WebMethod attributes or only with the WebMethod attribute.

6. Another restriction is that the method has to be static (or else it won't work).

7. For example:

[WebMethod]

public static string GetLabelText()

{

return "Hello";

}

<scripttype="text/javascript">

function InsertLabelData() {

PageMethods.GetLabelText(onSuccess, onFailure);

}

function onSuccess(result) {

var lbl = document.getElementById('lbl');

lbl.innerHTML = result;

}

function onFailure(error) {

alert(error);

}

InsertLabelData();

</script>

Whats with the -alpha in the install instructions?

HTML_AJAX hasn't had a stable release yet and the pear installer doesn't installnon stable packages by default unless you specify a version.

How do I submit a form or a part of a form without a page refresh?

When creating a form make sure that the "form" element "onSubmit" attribute isset to a JavaScript function that returns false.<form onSubmit="doAJAXSubmit();return false;" ><input type="text" id="tf1" /><input type="submit" id="submit1" value="Update"/></> You can also submit data by associating a function with a form button in a similarway.<form onSubmit="doAJAXSubmit();return false;" ><input type="text" id="tf1" /><input type="button" id="button1" onClick="doAJAXSubmit()"value="Update"/></>Note that the form "onSubmit" attribute is still set. If the user hits the enter keyin the text field the form will be submitted so you still need to handle that case.When updating the page it is recommend you wait to make sure that the AJAXupdate of the form data was successful before updating the data in the page.Otherwise, the data may not properly update and the user may not know. I like toprovide an informative message when doing a partial update and upon asuccessful AJAX interaction I will then update the page.

How do I test my AJAX code?

There is a port of JUnit for client-side JavaScript called JsUnit

What exactly is the W3C DOM?

The W3C Document Object Model (DOM) is defined by the W3C as the following: The Document Object Model is a platform- and language-neutral interface...

When will HTML_AJAX have a stable release?

Once all the major features are complete and the API has been tested, theroadmap gives an idea of whats left to be done.

What parts of the HTML_AJAX API are stable?

We don't have a list right now, but most of the API is stable as of 0.3.0. Thereshould be no major changes at this point, though there will be lots of newadditions.

What Browsers does HTML_AJAX work with?

As of 0.3.0, all the examples that ship with HTML_AJAX have been verified towork with* Firefox 1.0+* Internet Explorer 5.5+ (5.0 should work but it hasn't been tested)Most things work with* Safari 2+

Is the server or the client in control?

It depends. With AJAX the answer is more in between. Control can be morecentralized in a server-side component or as a mix of client-side and server-sidecontrollers.* Centralized server-side controller - When having a more centralized controllerthe key is to make sure the data in client-side page is in sync with that of theserver. Some applications may keep all the state on the server and push allupdates to client DOM via a simple JavaScript controller.* Client and server-side controllers - This architecture would use JavaScript to doall presentation related control, event processing, page manipulation, andrendering of model data on the client. The server-side would be responsible forthings such as business logic and pushing updated model data to the client. Inthis case the server would not have intimate knowledge of the presentation shortof the initial page that would be sent to the client page request. There are some use cases where an entire AJAX application can be written in asingle page. Keep in mind if you choose this type of architecture that navigationand bookmarking should be considered.Both methods are viable depending on what you are trying to accomplish. I tendto prefer spreading the control across the client and server.

Is Ajax just another name for XMLHttpRequest?

No. XMLHttpRequest is only part of the Ajax equation. XMLHttpRequest is thetechnical component that makes the asynchronous server communicationpossible; Ajax is our name for the overall approach described in the article, whichrelies not only on XMLHttpRequest, but on CSS, DOM, and other technologies.

How do I abort the current XMLHttpRequest?

Just call the abort() method on the request.

What is the minimum version of PHP that needs to be running in order touse HTML_AJAX?

The oldest PHP version i've fully tested HTML_AJAX is 4.3.11, but it should run on4.2.0 without any problems. (Testing reports from PHP versions older then 4.3.11would be appreciated.)

Why does HTML_AJAX hang on some server installs

If you run into an HTML_AJAX problem only on some servers, chances are yourrunning into a problem with output compression. If the output compression ishandled in the PHP config we detect that and do the right thing, but if its donefrom an apache extension we have no way of knowing its going to compress thebody. Some times setting HTML_AJAX::sendContentLength to false fixes theproblem, but in other cases you'll need to disabled the extension for the AJAXpages.I've also seen problems caused by debugging extensions like XDebug, disablingthe extension on the server page usually fixes that. Questions dealing with UsingHTML_AJAX, and general JavaScript development

How do I get the XMLHttpRequest object?

Depending upon the browser... if (window.ActiveXObject) { // Internet Explorerhttp_request = new ActiveXObject("Microsoft.XMLHTTP"); } else if...

Are there any security issues with AJAX?

JavaScript is in plain view to the user with by selecting view source of the page. JavaScript can not access the local filesystem without the user's permission. AnAJAX interaction can only be made with the servers-side component from whichthe page was loaded. A proxy pattern could be used for AJAX interactions withexternal services. You need to be careful not to expose your application model in such as way thatyour server-side components are at risk if a nefarious user to reverse engineeryour application. As with any other web application, consider using HTTPS tosecure the connection when confidential information is being exchanged.

What about applets and plugins ?

Don't be too quick to dump your plugin or applet based portions of yourapplication. While AJAX and DHTML can do drag and drop and other advanceduser interfaces there still limitations especially when it comes to browser support.Plugins and applets have been around for a while and have been able to makeAJAX like requests for years. Applets provide a great set of UI components andAPIs that provide developers literally anything.Many people disregard applets or plugins because there is a startup time toinitialize the plugin and there is no guarantee that the needed version of a pluginof JVM is installed. Plugins and applets may not be as capable of manipulating thepage DOM. If you are in a uniform environment or can depend on a specific JVMor plugin version being available (such as in a corporate environment) a plugin orapplet solution is great.One thing to consider is a mix of AJAX and applets or plugins. Flickr uses acombination of AJAX interactions/DHTML for labeling pictures and user interactionand a plugin for manipulating photos and photo sets to provide a great userexperience. If you design your server-side components well they can talk to bothtypes of clients.

Why did you feel the need to give this a name?

I needed something shorter than “Asynchronous JavaScript+CSS+DOM+XMLHttpRequest” to use when discussing this approachwith clients.

Is AJAX code cross browser compatible?

Not totally. Most browsers offer a native XMLHttpRequest JavaScript object, whileanother one (Internet Explorer) require you to get it as an ActiveX object

(1) What is Ajax?

Ans: Ajax is abbreviated as Asynchronous Ja vascript and XML. It is new technique used to create better, faster and more interactive web systems or applications. Ajax uses asynchronous data transfer between the Browser and the web server.

This technique is used to make internet faster and user friendly. It is not a programming language.

(2) What are Ajax applications?

Ans: Browser based applications and platform independent applications are used by Ajax.

(3) 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

(4) What are the disadvantages of Ajax?

Ans: Following are the disadvantages of Ajax:

  • AJAX is dependent on Javascript. If there is some Javascript problem with the browser or in the OS, Ajax will not support.
  • Ajax can be problematic in Search engines as it uses Javascript for most of its parts.
  • 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.

(5) What are all the technologies used by Ajax?

Ans: AJAX uses following technologies:

  • JavaScript
  • XMLHttpRequest
  • Document Object Model (DOM)
  • Extensible HTML (XHTML)
  • Cascading Style Sheets (CSS)

(6) What Is the Format of an AJAX Request?

Ans: An AJAX request can be in any format:

  • Text File
  • HTML
  • JSON object

(7) 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

(8) 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.

(9) 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.

(10) Is AJAX code cross browser compatible?

Ans: Not totally. Most browsers offer a native XMLHttpRequest JavaScript object, while another one (Internet Explorer) require you to get it as an ActiveX object

(11) 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

(12) How can you test the Ajax code?

Ans: JSUnit is the client side javascript code used as part of JUnit. JSUnit has been used for Ajax code.

(13) 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.

(14) What is JSON in Ajax?

Ans: JSON is abbreviated as JavaScript Object Notation. JSON is a safe and reliable data interchange format in JavaScript, which is easy to understand for both users and machines.

(15) What are all the different data types that JSON supports?

Ans: JSON supports following data types:

  • String
  • Number
  • Boolean
  • Array
  • Object
  • Null

What's AJAX ?
AJAX (Asynchronous JavaScript and XML) is a newly coined term for two powerful browser features that have been around for years, but were overlooked by many web developers until recently when applications such as Gmail, Google Suggest, and Google Maps hit the streets.

Asynchronous JavaScript and XML, or Ajax (pronounced "Aye-Jacks"), is a web development technique for creating interactive web applications using a combination of XHTML (or HTML) and CSS for marking up and styling information. (XML is commonly used, although any format will work, including preformatted HTML, plain text, JSON and even EBML).
The Document Object Model manipulated through JavaScript to dynamically display and interact with the information presented
The XMLHttpRequest object to exchange data asynchronously with the web server. In some Ajax frameworks and in some situations, an IFrame object is used instead of the XMLHttpRequest object to exchange data with the web server.
Like DHTML, LAMP, or SPA, Ajax is not a technology in itself, but a term that refers to the use of a group of technologies together. In fact, derivative/composite technologies based substantially upon Ajax, such as AFLAX, are already appearing.
Ajax applications are mostly executed on the user's computer; they can perform a number of tasks without their performance being limited by the network. This permits the development of interactive applications, in particular reactive and rich graphic user interfaces.
Ajax applications target a well-documented platform, implemented by all major browsers on most existing platforms. While it is uncertain that this compatibility will resist the advent of the next generations of browsers (in particular, Firefox), at the moment, Ajax applications are effectively cross-platform.
While the Ajax platform is more restricted than the Java platform, current Ajax applications effectively fill part of the one-time niche of Java applets: extending the browser with portable, lightweight mini-applications.

Ajax isn’t a technology. It’s really several technologies, each flourishing in its own right, coming together in powerful new ways. Ajax incorporates:
* standards-based presentation using XHTML and CSS;
* dynamic display and interaction using the Document Object Model;
* data interchange and manipulation using XML and XSLT; * asynchronous data retrieval using XMLHttpRequest;
* and JavaScript binding everything together.

Who’s Using Ajax ?
Google is making a huge investment in developing the Ajax approach. All of the major products Google has introduced over the last year — Orkut, Gmail, the latest beta version of Google Groups, Google Suggest, and Google Maps — are Ajax applications. (For more on the technical nuts and bolts of these Ajax implementations, check out these excellent analyses of Gmail, Google Suggest, and Google Maps.) Others are following suit: many of the features that people love in Flickr depend on Ajax, and Amazon’s A9.com search engine applies similar techniques.
These projects demonstrate that Ajax is not only technically sound, but also practical for real-world applications. This isn’t another technology that only works in a laboratory. And Ajax applications can be any size, from the very simple, single-function Google Suggest to the very complex and sophisticated Google Maps.

[_private/tble_firefox.htm]

At Adaptive Path, we’ve been doing our own work with Ajax over the last several months, and we’re realizing we’ve only scratched the surface of the rich interaction and responsiveness that Ajax applications can provide. Ajax is an important development for Web applications, and its importance is only going to grow. And because there are so many developers out there who already know how to use these technologies, we expect to see many more organizations following Google’s lead in reaping the competitive advantage Ajax provides.
Moving Forward

The biggest challenges in creating Ajax applications are not technical. The core Ajax technologies are mature, stable, and well understood. Instead, the challenges are for the designers of these applications: to forget what we think we know about the limitations of the Web, and begin to imagine a wider, richer range of possibilities

Should I consider AJAX?
AJAX definitely has the buzz right now, but it might not be the right thing for you. AJAX is limited to the latest browsers, exposes browser compatibility issues, and requires new skill-sets for many. There is a good blog entry by Alex Bosworth on AJAX Mistakes which is a good read before you jump full force into AJAX.
On the other hand you can achieve highly interactive rich web applications that are responsive and appear really fast. While it is debatable as to whether an AJAX based application is really faster, the user feels a sense of immediacy because they are given active feedback while data is exchanged in the background. If you are an early adopter and can handle the browser compatibility issues, and are willing to learn some more skills, then AJAX is for you. It may be prudent to start off AJAX-ifying a small portion or component of your application first. We all love technology, but just remember the purpose of AJAX is to enhance your user's experience and not hinder it.

Does AJAX work with Java?
Absolutely. Java is a great fit for AJAX! You can use Java Enterprise Edition servers to generate AJAX client pages and to serve incoming AJAX requests, manage server side state for AJAX clients, and connect AJAX clients to your enterprise resources. The JavaServer Faces component model is a great fit for defining and using AJAX components.

Won't my server-side framework provide me with AJAX?
You may be benefiting from AJAX already. Many existing Java based frameworks already have some level of AJAX interactions and new frameworks and component libraries are being developed to provide better AJAX support. I won't list all the Java frameworks that use AJAX here, out of fear of missing someone, but you can find a good list at www.ajaxpatterns.org/Java_Ajax_Frameworks.
If you have not chosen a framework yet it is recommended you consider using JavaServer Faces or a JavaServer Faces based framework. JavaServer Faces components can be created and used to abstract many of the details of generating JavaScript, AJAX interactions, and DHTML processing and thus enable simple AJAX used by JSF application developer and as plug-ins in JSF compatible IDE's, such as Sun Java Studio Creator.

Where should I start?
Assuming the framework you are using does not suffice your use cases and you would like to develop your own AJAX components or functionality I suggest you start with the article Asynchronous JavaScript Technology and XML (AJAX) With Java 2 Platform, Enterprise Edition.
If you would like to see a very basic example that includes source code you can check out the tech tip Using AJAX with Java Technology. For a more complete list of AJAX resources the Blueprints AJAX home page.
Next, I would recommend spending some time investigating AJAX libraries and frameworks. If you choose to write your own AJAX clients-side script you are much better off not re-inventing the wheel.
AJAX in Action by Dave Crane and Eric Pascarello with Darren James is good resource. This book is helpful for the Java developer in that in contains an appendix for learning JavaScript for the Java developer.

Did Adaptive Path invent Ajax? Did Google? Did Adaptive Path help build Google’s Ajax applications?
Neither Adaptive Path nor Google invented Ajax. Google’s recent products are simply the highest-profile examples of Ajax applications. Adaptive Path was not involved in the development of Google’s Ajax applications, but we have been doing Ajax work for some of our other clients.

Is it possible to set session variables from javascript?
It's not possible to set any session variables directly from javascript as it is purely a client side technology. You can use AJAX though to asyncronously...

Cannot parse XML generated by JSP I am generating an XML using JSP, when i run the JSP in IE it shows the XML as per DOM, but when i try to parse it using Javascript , the command xmldoc.documentElement...

This is working code I am using, it might help you. if (!isIE) xmldoc = req.responseXML; else { //IE does not take the responseXML as...

What do I need to know to create my own AJAX functionality?
If you plan not to reuse and existing AJAX component here are some of the things you will need to know.
Plan to learn Dynamic HTML (DHTML), the technology that is the foundation for AJAX. DHTML enables browser-base real time interaction between a user and a web page. DHTML is the combination of JavaScript, the Document Object Model (DOM) and Cascading Style Sheets (CSS).
* JavaScript - JavaScript is a loosely typed object based scripting language supported by all major browsers and essential for AJAX interactions. JavaScript in a page is called when an event in a page occurs such as a page load, a mouse click, or a key press in a form element.
* DOM - An API for accessing and manipulating structured documents. In most cases DOM represent the structure of XML and HTML documents.
* CSS - Allows you to define the presentation of a page such as fonts, colors, sizes, and positioning. CSS allow for a clear separation of the presentation from the content and may be changed programmatically by JavaScript.
Understanding the basic request/response nature of HTTP is also important. Many subtle bugs can result if you ignore the differences between the GET and OIst methods when configuring an XMLHttpRequest and HTTP response codes when processing callbacks.
JavaScript is the client-side glue, in a sense. JavaScript is used to create the XMLHttpRequest Object and trigger the asynchronous call. JavaScript is used to parse the returned content. JavaScript is used to analyze the returned data and process returned messages. JavaScript is used to inject the new content into the HTML using the DOM API and to modify the CSS.

Do I really need to learn JavaScript?
Basically yes if you plan to develop new AJAX functionality for your web application.
On the other hand, JSF components and component libraries can abstract the details of JavaScript, DOM and CSS. These components can generate the necessary artifacts to make AJAX interactions possible. Visual tools such as Java Studio Creator may also use AJAX enabled JSF components to create applications, shielding the tool developer from many of the details of

[_private/tbl_gglapck.htm]

AJAX. If you plan to develop your own JSF components or wire the events of components together in a tool it is important that you have a basic understanding of JavaScript. There are client-side JavaScript libraries (discussed below) that you can call from your in page JavaScript that abstract browser differences. Object Hierarchy and Inheritance in JavaScript is a great resource for a Java developer to learn about JavaScript objects.

Do Ajax applications always deliver a better experience than traditional web applications?
Not necessarily. Ajax gives interaction designers more flexibility. However, the more power we have, the more caution we must use in exercising it. We must be careful to use Ajax to enhance the user experience of our applications, not degrade it.

What JavaScript libraries and frameworks are available?
There are many libraries/frameworks out there (and many more emerging) that will help abstract such things as all the nasty browser differences. Three good libraries are The Dojo Toolkit, Prototype, and DWR.

* The Dojo Toolkit contains APIs and widgets to support the development of rich web applications. Dojo contains an intelligent packaging system, UI effects, drag and drop APIs, widget APIs, event abstraction, client storage APIs, and AJAX interaction APIs. Dojo solves common usability issues such as support for dealing with the navigation such as the ability to detect the browser back button, the ability to support changes to the URL in the URL bar for bookmarking, and the ability to gracefully degrade when AJAX/JavaScript is not fully support on the client. Dojo is the Swiss Army Knife of JavaScript libraries. It provides the widest range of options in a single library and it does a very good job supporting new and older browsers.
* Prototype focuses on AJAX interactions including a JavaScript AJAX object that contains a few objects to do basic tasks such as make a request, update a portion of a document, insert content into a document, and update a portion of a document periodically. Prototype JavaScript library contains a set of JavaScript objects for representing AJAX requests and contains utility functions for accessing in page components and DOM manipulations. Script.aculo.us and Rico are built on top of Prototype and provide UI effects, support for drag and drop, and include common JavaScript centric widgets. If you are just looking to support AJAX interactions and a few basic tasks Prototype is great. If you are looking for UI effects Rico and Script.aculo.us are good options.
* Yahoo UI Library is a utility library and set of widgets using the APIs to support rich clients. The utility library includes support for cross-browser AJAX interactions, animation, DOM scriptging support, drag and drop, and cross browser event support. The Yahoo UI Library is well documnented and contains many examples.
* DWR (Dynamic Web Remoting) is a client-side and server-side framework that focuses on allowing a developer to do RPC calls from client-side JavaScript to plain old Java objects in a Java Enterprise Edition web container. On the server side DWR uses a Servlet to interact with the Java objects and returns object representations of the Java objects or XML documents. DWR will be easy to get up and running and plays well with other Java technologies. If you are looking for a client-side and server-side framework that integrates well use DWR.
* Google Web Toolkit (GWT) is client/server framework provided by Google that allows a developer to write an AJAX application in pure Java. The GWT takes care of the details of generating all the client-side code using a Java-to-JavaScript compiler. One of the key benefits of the GWT Software Developer Kit (SDK) is that it allows you to debug your applications in what is known as GWT hosted mode using an embedded browser (IE on Windows and Mozilla/Gecko on Linux) that is tied to the toolkit. In GWT hosted mode you setup through the code and debug it as it is running on both the client and server. The GWT contains a default set of widgets and widget containers. An application is built by coding a set of widgets and containers together much like would be done in a Swing application. The GWT Software Developer Kit (SDK) is limited to Linux and Windows XP/2000 though the web applications it generates are compatible with the latest generation of the mainstream browsers.

There are many new and emerging libraries for JavaScript and this list only reviews some of the more common libraries. When making a choice choose the library which suites your needs the best. While it might be better to choose one, there is nothing stopping you from using more than one framework. For a more extensive list of client-side frameworks see: Survey of AJAX/JavaScript Libraries.

What is the difference between proxied and proxyless calls?
Proxied calls are made through stub objects that mimic your PHP classes on the JavaScript side. E.g., the helloworld class from the Hello World example.
Proxyless calls are made using utility javascript functions like HTML_AJAX.replace() and HTML_AJAX.append().

Should I use XML or text, JavaScript, or HTML as a return type?
It depends. Clearly the 'X' in AJAX stands for XML, but several AJAX proponents are quick to point out that nothing in AJAX, per se, precludes using other types of payload, such as, JavaScript, HTML, or plain text.

* XML - Web Services and AJAX seem made for one another. You can use client-side API's for downloading and parsing the XML content from RESTful Web Services. (However be mindful with some SOAP based Web Services architectures the payloads can get quite large and complex, and therefore may be inappropriate with AJAX techniqes.)
* Plain Text - In this case server-generated text may be injected into a document or evaluated by client-side logic.
* JavaScript - This is an extension to the plain text case with the exception that a server-side component passes a fragment of JavaScript including JavaScript object declarations. Using the JavaScript eval() function you can then create the objects on the client. JavaScript Object Notation (JSON), which is a JavaScript object based data exchange specification, relies on this technique.
* HTML - Injecting server-generated HTML fragments directly into a document is generally a very effective AJAX technique. However, it can be complicated keeping the server-side component in sync with what is displayed on the client.

Mashup is a popular term for creating a completely new web application by combining the content from disparate Web Services and other online API's. A good example of a mashup is housingmaps.com which graphically combines housing want-ads from craiglist.org and maps from maps.google.com.

Are there Usability Issues with AJAX?
The nature of updating a page dynamically using data retrieved via AJAX interactions and DHTML may result in drastically changing the appearance and state of a page. A user might choose to use the browser's back or forward buttons, bookmark a page, copy the URL from the URL bar and share it with a friend via an email or chat client, or print a page at any given time. When designing an AJAX based application you need to consider what the expected behavior would be in the case of navigation, bookmarking, printing, and browser support as described below.

* Navigation - What would be the expected behavior of the back, forward, refresh, and bookmark browser buttons in your application design. While you could implement history manipulation manually it may be easer to use a JavaScript frameworks such as Dojo that provides API's history manipulation and navigation control.
* Bookmarking and URL sharing - Many users want to bookmark or cut and paste the URL from the browser bar. Dojo provides client-side for bookmarking and URL manipulation.
* Printing - In some cases printing dynamically rendered pages can be problematic.
Other considerations as a developer when using AJAX are:
* Browser Support - Not all AJAX/DHTML features are supported on all browsers or all versions of a browser. See quirksmode.org for a list of browser support and possible workarounds.
* JavaScript disabled - You should also consider what happens if the user disables JavaScript. Additionally, there are several legitimate reasons why JavaScript and CSS support may be unavailable on a user's web browser.
* Latency - Keep in mind latency in your design. A running application will be much more responsive than when it is deployed.
Latency problems: myth or reality?
* Accessibility - Guaranteeing your site is accessible to people with disabilities is not only a noble goal, it is also requited by law in many markets. Some marvelous enabling technology is available to help people use the Web in spite of disabilities including visual, auditory, physical, speech, cognitive, and neurological disabilities. With a little forethought, and comprehension of some well documented best practices, you can assure that your application is compatible with that enabling technology.
Degradability is the term used to describe techniques used by web applications to adapt to the wide range of web browser capabilities. Many AJAX libraries have automatic degradability built in. But if you are coding your own custom AJAX functionality, simply taking some care to follow the best practices promoted by standards bodies like the World Wide Web Consortium (W3C), and grass root movements like the Web Standards community and many others, your application can run usefully on browsers that are incapable of AJAX behaviors. Granted, your application may loose some of the "wow factor" on these less capable browsers, but your application will still be usable.
Remember to not design with AJAX just for the sake of coolness. The reason you built your application is so people will use it. And people will not use your application if your application is not compatible with their web browser.

Are there any frameworks available to help speedup development with AJAX?
There are several browser-side frameworks available, each with their own uniqueness...

Is Adaptive Path selling Ajax components or trademarking the name? Where can I download it?
Ajax isn’t something you can download. It’s an approach — a way of thinking about the architecture of web applications using certain technologies. Neither the Ajax name nor the approach are proprietary to Adaptive Path.

Should I use an HTTP GET or POST for my AJAX calls?
AJAX requests should use an HTTP GET request when retrieving data where the data will not change for a given request URL. An HTTP POST should be used when state is updated on the server. This is in line with HTTP idempotency recommendations and is highly recommended for a consistent web application architecture.

How do I debug JavaScript?
There are not that many tools out there that will support both client-side and server-side debugging. I am certain this will change as AJAX applications proliferate. I currently do my client-side and server-side debugging separately. Below is some information on the client-side debuggers on some of the commonly used browsers.

* Firefox/Mozilla/Netscape - Have a built in debugger Venkman which can be helpful but there is a Firefox add on known as FireBug which provides all the information and AJAX developer would ever need including the ability to inspect the browser DOM, console access to the JavaScript runtime in the browser, and the ability to see the HTTP requests and responses (including those made by an XMLHttpRequest). I tend to develop my applications initially on Firefox using Firebug then venture out to the other browsers.
* Safari - Has a debugger which needs to be enabled. See the Safari FAQ for details.
* Internet Explorer - There is MSDN Documentation on debugging JavaScript. A developer toolbar for Internet Explorer may also be helpful.

While debuggers help a common technique knowing as "Alert Debugging" may be used. In this case you place "alert()" function calls inline much like you would a System.out.println. While a little primitive it works for most basic cases. Some frameworks such as Dojo provide APIs for tracking debug statements.

How do I provide internationalized AJAX interactions?
Just because you are using XML does not mean you can properly send and receive localized content using AJAX requests. To provide internationalized AJAX components you need to do the following:

* Set the charset of the page to an encoding that is supported by your target languages. I tend to use UTF-8 because it covers the most languages. The following meta declaration in a HTML/JSP page will set the content type:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
* In the page JavaScript make sure to encode any parameters sent to the server. JavaScript provides the escape() function which returns Unicode escape strings in which localized text will appear in hexadecimal format. For more details on JavaScript encoding see Comparing escape(), encodeURI(), and encodeURIComponent().
* On the server-side component set the character encoding using the HttpServletRequest.setCharacterEncoding() method. Before you access the localized parameter using the HttpServletRequest.getParameter() call. In the case of UTF this would be request.setCharactherEncoding("UTF-8");.
A server-side component returning AJAX responses needs to set the encoding of the response to the same encoding used in the page.
response.setContentType("text/xml;charset=;UTF-8");
response.getWriter().write(" <response>invalid </response>");

For more information on using AJAX with Java Enterprise Edition technologies see AJAX and Internationalization and for developing multi-lingual applications see Developing Multilingual Web Applications Using JavaServer Pages Technology.

Some of the Google examples you cite don’t use XML at all. Do I have to use XML and/or XSLT in an Ajax application?
No. XML is the most fully-developed means of getting data in and out of an Ajax client, but there’s no reason you couldn’t accomplish the same effects using a technology like JavaScript Object Notation or any similar means of structuring data for interchange.

Are Ajax applications easier to develop than traditional web applications?
Not necessarily. Ajax applications inevitably involve running complex JavaScript code on the client. Making that complex code efficient and bug-free is not a task to be taken lightly, and better development tools and frameworks will be needed to help us meet that challenge.

When do I use a synchronous versus a asynchronous request?
Good question. They don't call it AJAX for nothing! A synchronous request would block in page event processing and I don't see many use cases where a synchronous request is preferable.

How do I handle concurrent AJAX requests?
With JavaScript you can have more than one AJAX request processing at a single time. In order to insure the proper post processing of code it is recommended that you use JavaScript Closures. The example below shows an XMLHttpRequest object abstracted by a JavaScript object called AJAXInteraction. As arguments you pass in the URL to call and the function to call when the processing is done.
function AJAXInteraction(url, callback) {

var req = init();
req.onreadystatechange = processRequest;

function init() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
} else if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
}

function processRequest () {
if (req.readyState == 4) {
if (req.status == 200) {
if (callback) callback(req.responseXML);
}
}
}

this.doGet = function() {
req.open("GET", url, true);
req.send(null);
}

this.doPost = function(body) {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "
application/x-www-form-urlencoded");
req.send(body);
}
}

function makeRequest() {
var ai = new AJAXInteraction("processme",
function() { alert("Doing Post Process");});
ai.doGet();
}

The function makeRequest() in the example above creates an AJAXInteraction with a URL to of "processme" and an inline function that will show an alert dialog with the message "Doing Post Process". When ai.doGet() is called the AJAX interaction is initiated and when server-side component mapped to the URL "processme" returns a document which is passed to the callback function that was specified when the AJAXInteraction was created.
Using this closures insures that the proper callback function associated with a specific AJAX interaction is called. Caution should still be taken when creating multiple closure objects in that make XmlHttpRequests as to there is a limited number of sockets that are used to make requests at any given time. Because there are limited number of requests that can be made concurrently. Internet Explorer for example only allows for two concurrent AJAX requests at any given time. Other browsers may allow more but it is generally between three and five requests. You may choose to use pool of AJAXInteraction objects.
One thing to note when making multiple AJAX calls from the client is that the calls are not guaranteed to return in any given order. Having closures within the callback of a closure object can be used to ensure dependencies are processed correctly.
There is a discussion titled Ajaxian Fire and Forget Pattern that is helpful.

What do I do on the server to interact with an AJAX client?
The "Content-Type" header needs to be set to"text/xml". In servlets this may be done using the HttpServletResponse.setContentType()should be set to "text/xml" when the return type is XML. Many XMLHttpRequest implementations will result in an error if the "Content-Type" header is set The code below shows how to set the "Content-Type".

response.setContentType("text/xml");
response.getWriter().write("<response>invalid</response>");

You may also want to set whether or not to set the caches header for cases such as autocomplete where you may want to notify proxy servers/and browsers not to cache the results.

response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");
response.getWriter().write("<response>invalid</response>");

Note to the developer: Internet Explorer will automatically use a cached result of any AJAX response from a HTTP GET if this header is not set which can make things difficult for a developer. During development mode you may want set this header. Where do I store state with an AJAX client

As with other browser based web applications you have a few options which include:
* On the client in cookies - The size is limited (generally around 4KB X 20 cookies per domain so a total of 80KB) and the content may not be secure unless encrypted which is difficult but not impossible using JavaScript.
* On the client in the page - This can be done securely but can be problematic and difficult to work with. See my blog entry on Storing State on the Client for more details on this topic.
* On the client file system - This can be done if the client grants access to the browser to write to the local file system. Depending on your uses cases this may be necessary but caution is advised.
* On the Server - This is closer to the traditional model where the client view is of the state on the server. Keeping the data in sync can be a bit problematic and thus we have a solution Refreshing Data on this. As more information processing and control moves to the client where state is stored will need to be re-evaluated.

Whats with the -alpha in the install instructions?
HTML_AJAX hasn't had a stable release yet and the pear installer doesn't install non stable packages by default unless you specify a version.

How do I submit a form or a part of a form without a page refresh?
When creating a form make sure that the "form" element "onSubmit" attribute is set to a JavaScript function that returns false.
<form onSubmit="doAJAXSubmit();return false;" >
<input type="text" id="tf1" />
<input type="submit" id="submit1" value="Update"/>
</>

You can also submit data by associating a function with a form button in a similar way.

<form onSubmit="doAJAXSubmit();return false;" >
<input type="text" id="tf1" />
<input type="button" id="button1" onClick="doAJAXSubmit()" value="Update"/>
</>

Note that the form "onSubmit" attribute is still set. If the user hits the enter key in the text field the form will be submitted so you still need to handle that case.
When updating the page it is recommend you wait to make sure that the AJAX update of the form data was successful before updating the data in the page. Otherwise, the data may not properly update and the user may not know. I like to provide an informative message when doing a partial update and upon a successful AJAX interaction I will then update the page.

How do I test my AJAX code?
There is a port of JUnit for client-side JavaScript called JsUnit

What exactly is the W3C DOM?
The W3C Document Object Model (DOM) is defined by the W3C as the following: The Document Object Model is a platform- and language-neutral interface...

When will HTML_AJAX have a stable release?
Once all the major features are complete and the API has been tested, the roadmap gives an idea of whats left to be done.

What parts of the HTML_AJAX API are stable?
We don't have a list right now, but most of the API is stable as of 0.3.0. There should be no major changes at this point, though there will be lots of new additions.

What Browsers does HTML_AJAX work with?
As of 0.3.0, all the examples that ship with HTML_AJAX have been verified to work with
* Firefox 1.0+
* Internet Explorer 5.5+ (5.0 should work but it hasn't been tested)
Most things work with
* Safari 2+
* Opera 8.5+



Is the server or the client in control?
It depends. With AJAX the answer is more in between. Control can be more centralized in a server-side component or as a mix of client-side and server-side controllers.

* Centralized server-side controller - When having a more centralized controller the key is to make sure the data in client-side page is in sync with that of the server. Some applications may keep all the state on the server and push all updates to client DOM via a simple JavaScript controller.
* Client and server-side controllers - This architecture would use JavaScript to do all presentation related control, event processing, page manipulation, and rendering of model data on the client. The server-side would be responsible for things such as business logic and pushing updated model data to the client. In this case the server would not have intimate knowledge of the presentation short of the initial page that would be sent to the client page request.

There are some use cases where an entire AJAX application can be written in a single page. Keep in mind if you choose this type of architecture that navigation and bookmarking should be considered.
Both methods are viable depending on what you are trying to accomplish. I tend to prefer spreading the control across the client and server.

Is Ajax just another name for XMLHttpRequest?
No. XMLHttpRequest is only part of the Ajax equation. XMLHttpRequest is the technical component that makes the asynchronous server communication possible; Ajax is our name for the overall approach described in the article, which relies not only on XMLHttpRequest, but on CSS, DOM, and other technologies.

How do I abort the current XMLHttpRequest?
Just call the abort() method on the request.

What is the minimum version of PHP that needs to be running in order to use HTML_AJAX?
The oldest PHP version i've fully tested HTML_AJAX is 4.3.11, but it should run on 4.2.0 without any problems. (Testing reports from PHP versions older then 4.3.11 would be appreciated.)

Why does HTML_AJAX hang on some server installs
If you run into an HTML_AJAX problem only on some servers, chances are your running into a problem with output compression. If the output compression is handled in the PHP config we detect that and do the right thing, but if its done from an apache extension we have no way of knowing its going to compress the body. Some times setting HTML_AJAX::sendContentLength to false fixes the problem, but in other cases you'll need to disabled the extension for the AJAX pages.
I've also seen problems caused by debugging extensions like XDebug, disabling the extension on the server page usually fixes that. Questions dealing with Using HTML_AJAX, and general JavaScript development

How do I get the XMLHttpRequest object?
Depending upon the browser... if (window.ActiveXObject) { // Internet Explorer http_request = new ActiveXObject("Microsoft.XMLHTTP"); } else if...

Are there any security issues with AJAX?
JavaScript is in plain view to the user with by selecting view source of the page. JavaScript can not access the local filesystem without the user's permission. An AJAX interaction can only be made with the servers-side component from which the page was loaded. A proxy pattern could be used for AJAX interactions with external services.
You need to be careful not to expose your application model in such as way that your server-side components are at risk if a nefarious user to reverse engineer your application. As with any other web application, consider using HTTPS to secure the connection when confidential information is being exchanged.

What about applets and plugins ?
Don't be too quick to dump your plugin or applet based portions of your application. While AJAX and DHTML can do drag and drop and other advanced user interfaces there still limitations especially when it comes to browser support. Plugins and applets have been around for a while and have been able to make AJAX like requests for years. Applets provide a great set of UI components and APIs that provide developers literally anything.
Many people disregard applets or plugins because there is a startup time to initialize the plugin and there is no guarantee that the needed version of a plugin of JVM is installed. Plugins and applets may not be as capable of manipulating the page DOM. If you are in a uniform environment or can depend on a specific JVM or plugin version being available (such as in a corporate environment) a plugin or applet solution is great.
One thing to consider is a mix of AJAX and applets or plugins. Flickr uses a combination of AJAX interactions/DHTML for labeling pictures and user interaction and a plugin for manipulating photos and photo sets to provide a great user experience. If you design your server-side components well they can talk to both types of clients.

Why did you feel the need to give this a name?
I needed something shorter than “Asynchronous JavaScript+CSS+DOM+XMLHttpRequest” to use when discussing this approach with clients.

Is AJAX code cross browser compatible?
Not totally. Most browsers offer a native XMLHttpRequest JavaScript object, while another one (Internet Explorer) require you to get it as an ActiveX object....

Techniques for asynchronous server communication have been around for years. What makes Ajax a “new” approach?
What’s new is the prominent use of these techniques in real-world applications to change the fundamental interaction model of the Web. Ajax is taking hold now because these technologies and the industry’s understanding of how to deploy them most effectively have taken time to develop.

Is Ajax a technology platform or is it an architectural style?
It’s both. Ajax is a set of technologies being used together in a particular way.

How do I handle the back and forward buttons?
While you could go out and create a custom solution that tracks the current state on your application I recommend you leave this to the experts. Dojo addresses the navigation in a browser neutral way as can be seen in the JavaScript example below.
function updateOnServer(oldId, oldValue,
itemId, itemValue) {
var bindArgs = {
url: "faces/ajax-dlabel-update",
method: "post",
content: {"component-id": itemId, "component-value":
itemValue},
mimetype: "text/xml",
load: function(type, data) {
processUpdateResponse(data);
},
backButton: function() {
alert("old itemid was " + oldId);
},
forwardButton: function(){
alert("forward we must go!");
}
};
dojo.io.bind(bindArgs);
}

The example above will update a value on the server using dojo.io.bind() with a function as a property that is responsible for dealing with the browser back button event. As a developer you are capable of restoring the value to the oldValue or taking any other action that you see fit. The underlying details of how the how the browser button event are detected are hidden from the developer by Dojo.
AJAX: How to Handle Bookmarks and Back Buttons details this problem and provides a JavaScript library Really Simple History framework (RSH) that focuses just on the back and forward issue.

How does HTML_AJAX compare with the XAJAX project at Sourceforge?
XAJAX uses XML as a transport for data between the webpage and server, and you don't write your own javascript data handlers to manipulate the data received from the server. Instead you use a php class and built in javascript methods, a combination that works very similiar to the HTML_AJAX_Action class and haSerializer combo. XAJAX is designed for simplicity and ease of use.
HTML_AJAX allows for multiple transmission types for your ajax data - such as urlencoding, json, phpserialized, plain text, with others planned, and has a system you can use to write your own serializers to meet your specific needs. HTML_AJAX has a class to help generate javascript (HTML_AJAX_Helper) similiar to ruby on rail's javascript helper (although it isn't complete), and an action system similiar to XAJAX's "action pump" that allows you to avoid writing javascript data handlers if you desire.
But it also has the ability to write your own data handling routines, automatically register classes and methods using a server "proxy" script, do different types of callbacks including grabbing remote urls, choose between sync and async requests, has iframe xmlhttprequest emulation fallback capabilities for users with old browsers or disabled activeX, and is in active development with more features planned (see the Road Map for details)
HTML_AJAX has additional features such as client pooling and priority queues for more advanced users, and even a javascript utility class. Although you can use HTML_AJAX the same way you use XAJAX, the additional features make it more robust, extensible and flexible. And it is a pear package, you can use the pear installer to both install and keep it up to date.
If you're asking which is "better" - as with most php scripts it's a matter of taste and need. Do you need a quick, simple ajax solution? Or do you want something that's flexible, extensible, and looking to incorporate even more great features? It depends on the project, you as a writer, and your future plans.

What browsers 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, among others.

How do I send an image using AJAX?
While it may appear that images are being sent when using AJAX with an application like Google Maps what is really happening is that the URLs of images are being send as the response of an AJAX request and those URLs are being set using DHTML.
In this example an XML document is returned from an AJAX interaction and the category bar is populated.

<categories>
<category>
<cat-id>1</cat-id>
<name>Books</name>
<description>Fun to read</description>
<image-url>books_icon.gif</image-url>
</category>
<category>
<cat-id>2</cat-id>
<name>Electronics</name>
<description>Must have gadgets</description>
<image-url>electronics.gif</image-url>
</category>
</categories>


Notice that the image-url element contains the location of the URL for the image representing a category. The callback method of an AJAX interaction will parse the response XML document and call the addCategory function for each category included in the response XML document. The addCategory function looks up a table row element "categoryTable" in body of the page and adds a row to the element which contains the image.

<scrip type="text/javascript" >

...

function addCategory(id, name, imageSrc) {

var categoryTable = document.getElementById("categoryTable");
var row = document.createElement("tr");
var catCell = document.createElement("td");
var img = document.createElement("img");
img.src = ("images\\" + imageSrc);
var link = document.createElement("a");
link.className ="category";
link.appendChild(document.createTextNode(name));
link.setAttribute("onclick", "catalog?command=category&catid=" + id);
catCell.appendChild(img);
catCell.appendChild(link);
row.appendChild(catCell);
categoryTable.appendChild(row);
}
</script>

...

<table>
<tr>
<td width="300" bgoclor="lightGray">
<table id="categoryTable" border="0" cellpadding="0"></table>
</td>
<td id="body" width="100%">Body Here</td>
</tr>
</table>


Note that the source of the image is set to the image source. The image is loaded by a subsequent HTTP request for the image at the URL "images/books_icon.gif" or "images/electronic_icon.gif" that occurs when the img element is added to the categoryTable.

Will HTML_AJAX integrate with other Javascript AJAX libraries such as scriptaculous ? How would this integration look like?
HTML_AJAX doesn't have specific plans to integrate with other JavaScript libraries. Part of this is because external dependencies make for a more complicated installation process. It might make sense to offer some optional dependencies on a library like scriptaculous automatically using its visual effects for the loading box or something, but there isn't a lot to gain from making default visuals like that flashier since they are designed to be easily replaceable.

Most integration would take place in higher level components. Its unclear whether higher level components like that should be part of HTML_AJAX delivered through PEAR or if they should just be supported by HTML_AJAX and made available from http://htmlajax.org or some other site. If your interested in building widgets or components based on HTML_AJAX please let me know.

HTML_AJAX does however offer the ability to use its library loading mechanism with any JavaScript library. I use scriptaculous in conjunction with HTML_AJAX and I load both libraries through the server.

To do this you just need to register the library with your server and load add its flag to your include line.

<?php
$this->server->registerJSLibrary('scriptaculous',
array('prototype.js','scriptaculous.js','builder.js','effects.js','dragdrop.js','controls.js','slider.js'), '/pathto/scriptaculous/');?>
<script type="text/javascrpt" src="server.php?client=scriptaculous"></script>



When should I use an Java applet instead of AJAX?
Applets provide a rich experience on the client side and there are many things they can do that an AJAX application cannot do, such as custom data streaming, graphic manipulation, threading, and advanced GUIs. While DHTML with the use of AJAX has been able to push the boundaries on what you can do on the client, there are some things that it just cannot do. The reason AJAX is so popular is that it only requires functionality built into the browser (namely DHTML and AJAX capabilities). The user does not need to download and/or configure plugins. It is easy to incrementally update functionality and know that that functionality will readily available, and there are not any complicated deployment issues. That said, AJAX-based functionality does need to take browser differences into consideration. This is why we recommend using a JavaScript library such as Dojo which abstracts browser differences. So the "bottom line" is: If you are creating advanced UIs where you need more advanced features on the client where you want UI accuracy down to the pixel, to do complex computations on the client, use specialized networking techniques, and where you know that the applet plugin is available for your target audience, applets are the way to go. AJAX/DHTML works well for applications where you know the users are using the latest generation of browsers, where DHTML/AJAX "good enough" for you, and where your developers have JavaScript/DHTML/AJAX skills. Many amazing things can be done with AJAX/DHTML but there are limitations. AJAX and applets can be used together in the same UIs with AJAX providing the basic structure and applets providing more advanced functionality. The Java can communicate to JavaScript using the Live-Connect APIs. The question should not be should framed as do I use AJAX or applets, but rather which technology makes the best sense for what you are doing. AJAX and applets do not have to be mutually exclusive.

What kinds of applications is Ajax best suited for?
We don’t know yet. Because this is a relatively new approach, our understanding of where Ajax can best be applied is still in its infancy. Sometimes the traditional web application model is the most appropriate solution to a problem.

Does this mean Adaptive Path is anti-Flash?
Not at all. Macromedia is an Adaptive Path client, and we’ve long been supporters of Flash technology. As Ajax matures, we expect that sometimes Ajax will be the better solution to a particular problem, and sometimes Flash will be the better solution. We’re also interested in exploring ways the technologies can be mixed (as in the case of Flickr, which uses both).

Where can I find examples of AJAX?
While components of AJAX have been around for some time (for instance, 1999 for XMLHttpRequest), it really didn't become that popular until Google took...

What is the XMLHttpRequest object?
It offers a non-blocking way for JavaScript to communicate back to the web server to update only part of the web page.

Does Ajax have significant accessibility or browser compatibility limitations? Do Ajax applications break the back button? Is Ajax compatible with REST? Are there security considerations with Ajax development? Can Ajax applications be made to work for users who have JavaScript turned off?
The answer to all of these questions is “maybe”. Many developers are already working on ways to address these concerns. We think there’s more work to be done to determine all the limitations of Ajax, and we expect the Ajax development community to uncover more issues like these along the way.

How do I access data from other domains to create a mashup with Java?
From your JavaScript clients you can access data in other domains if the return data is provide in JSON format. In essence you can create a JavaScript client that runs operates using data from a different server. This technique is know as JSON with Padding or JSONP. There are questions as to whether this method is secure as you are retrieving data from outside your domain and allowing it to be excuted in the context of your domain. Not all data from third parties is accessible as JSON and in some cases you may want an extra level of protection. With Java you can provide a proxy to third party services using a web component such as a servlet. This proxy can manage the communication with a third party service and provide the data to your clients in a format of your choosing. You can also cache data at your proxy and reduce trips to service. For more on using a Java proxy to create mashups see The XmlHttpProxy Client for Java.

Does Java have support for Comet style server-side push?
Current AJAX applications use polling to communicate changes data between the server and client. Some applications, such as chat applications, stock tickers, or score boards require more immediate notifications of updates to the client. Comet is an event based low latency server side push for AJAX applications. Comet communication keeps one of the two connections available to the browser open to continously communicate events from the server to the client. A Java based solution for Comet is being developed for Glassfish on top of the Grizzly HTTP connector. See Enabling Grizzly by Jean-Francois Arcand for more details.

How do I create a thread to do AJAX polling?
JavaScript does not have threads. JavaScript functions are called when an event happens in a page such as the page is loaded, a mouse click, or a form element gains focus. You can create a timer using the setTimeout which takes a function name and time in milliseconds as arguments. You can then loop by calling the same function as can be seen in the JavaScript example below.

function checkForMessage() {
// start AJAX interaction with processCallback as the callback function
}

// callback for the request
function processCallback() {

// do post processing
setTimeout("checkForMessage()", 10000);
}

Notice that the checkForMessage will continue to loop indefinitely. You may want to vary the increment the interval based on activity in the page or your use cases. You may also choose to have logic that would break out of the loop based on some AJAX response processing condition.

Is the XMLHttpRequest object part of a W3C standard?
No. Or not yet. It is part of the DOM Level 3 Load and Save Specification proposal.

Question 1 : What is AJAX? What functions does it serve?
Answer : AJAX stands for Asynchronous JavaScript and XML, a technology derived from the two very prominent browser functions. By combining both these features, a lot of interactive and useful web applications are being developed.

Question 2 : Why are Postback triggers used for?
Answer : Postback triggers are used to upload files while using the FileUpload control within the update panel.

Question 3 : How many controls are there in AJAX?
Answer : There are basically five controls in AJAX, namely:

  • ScriptManager
  • UpdatePanel
  • UpdateProgress
  • Timer
  • ScriptManageProxy

Question 4 : Is it possible to use client-side image maps in AJAX?
Answer : Yes. Client-side image maps can bed used in Ajax.

Question 5 : What is wrapper?
Answer : Wrapper is an object that facilitates the enclosing of an object in the source language.

Question 6 : Give a situation where using AJAX is not feasible.
Answer : One situation where using AJAX is not feasible is while creating functions of online transactions or transfer of critical information. Another instance where AJAX should not be used is when the browser does not support Java or when the client wants their page to appear on a search engine result page.

Question 7 : What is a comet?
Answer : Comet is the situation where instead of the browser retrieving the data, the server continues to push the data to the client.

.

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.

Technical Symposium.Com All Jobs & Certifications
Lecture Notes and Scholarships & Project Details

Fresher Jobs Details
job detailsAll Fresher Software Jobs Details
job detailsAll Government Jobs Details
job detailsAll Internships Details
job detailsOff-Campus Interviews/Walk-in Details
job detailsAll Competitive Exam Details
job detailsBank Clerk/Officers Jobs Details
job detailsB.Sc/M.Sc Graduate Fresher Jobs
job detailsAll Technical Jobs Details
job detailsAll State/Central Government Jobs Details
Conference/Symposium Details
job detailsAll International Conference Details
job detailsAll National Conference Details
job detailsAll Symposium/Workshop Details
job detailsUniversity Conferences Details
job detailsIIT/NIT/IIM Conference Details
job detailsComputer Science Conference Details
job detailsElectronics Conferences Details
job detailsMechanical Conferences Details
job detailsAll Latest Conferences Details
Calendar of Events Details
job detailsJanuary – List of All Event Details
job detailsFebruary – List of All Event Details
job detailsMarch– List of All Event Details
job detailsApril – List of All Event Details
job detailsMay – List of All Event Details
job detailsJune – List of All Event Details
job detailsJuly – List of All Event Details
job detailsAugust – List of All Event Details
job detailsAll Months - List of All Events Details
GATE Question Papers & Syllabus
job detailsAll GATE Previous Year Question Papers
job detailsGATE Syllabus for All Branches
job detailsGATE-Computer Science Question Papers
job detailsGATE – Mechanical Question Papers
job detailsGATE – ECE Question Papers
job detailsGATE- EEE Question Papers
job detailsGATE – Civil Engineering Question Papers
job detailsGATE – All Branches Question Papers
job detailsGATE Exam Pattern Details
IES Question Papers & Syllabus
job detailsIES Complete Information
job detailsIES Previous Year Question Papers
job detailsIES Syllabus for All Branches
job detailsIES – Mechanical Question Papers
job detailsIES - E & T Question Papers
job detailsIES - EEE Question Papers
job detailsIES -Civil Engineering Question Papers
job detailsIES - All Branches Question Papers
job detailsIES - Exam Pattern Details
All Companies Placement Materials
job detailsTCS Placement Papers
job detailsWIPRO Placement Papers
job detailsZOHO Placement Papers
job detailsCTS Placement Papers
job detailsINFOSYS Placement Papers
job detailsARICENT Placement Papers
job detailsSBI Placement Papers
job detailsRRB Placement Papers
job detailsBANK/IBPS Placement Papers
Aptitude Round Materials
job details Problem on Numbers
job detailsProblem on Trains
job detailsTime and Work
job detailsSimple Interest
job detailsAptitude Short- Cut Formulas
job detailsAptitude Tricks
job detailsOdd Man Out Series
job detailsSimplification Problems
job detailsProfit & Loss
Technical Round Materials
job detailsJAVA Technical Round Q & A
job detailsC Technical Round Q & A
job detailsC++ Technical Round Q & A
job detailsASP.NET Technical Round Q & A
job detailsData Structure Technical Round Q & A
job detailsSQL Technical Round Q & A
job detailsC# Technical Round Q & A
job detailsPHP Technical Round Q & A
job detailsJ2EE Technical Round Q & A
Software Programs and Lab Manuals
job detailsSurvey Lab Manuals
job detailsCAD/CAM Lab Manuals
job detailsOOPS/C++ Lab Manuals
job detailsJAVA/Internet Programming Manuals
job detailsList of All C Programs with Source Code
job detailsList of All Data Structure Programs
job detailsC Aptitude Programs
job detailsMicroprocessor & Micro Controller Manuals
job detailsAll Engineering Branches Lab Manuals
Anna University Syllabus & Question Papers
job detailsB.E/B.Tech Previous Year Question Papers
job detailsBE-Computer Science Syllabus
job detailsBE-Mechanical Engineering Syllabus
job detailsBE-Civil Engineering Syllabus
job detailsBE-ECE Syllabus
job detailsBE-EEE Syllabus
job detailsMBA/MCA Syllabus
job detailsBE-Aeronautical Engineering Syllabus
job detailsBE-Biomedical Syllabus
IBPS/Bank Syllabus & Question Papers
job detailsIBPS Clerk Exam Syllabus
job detailsIBPS Clerk Question Papers
job detailsIBPS Probationary Officers Syllabus
job detailsIBPS PO Question Papers
job detailsIBPS RRB Exam Syllabus
job detailsIBPS Special Officers Exam Syllabus
job detailsSBI Clerk/PO Syllabus
job detailsAll Private Banks PO/Clerk Syllabuses
job detailsAll Nationalized Bank Po/Clerk Syllabuses
Civil Engineering Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
Mechanical Engineering Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
Computer Science Engineering Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
MCA Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
MBA Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
ECE Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
EEE Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
Biotechnology Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
Chemical Engineering Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
Biomedical Engineering Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
Aeronautical Engineering Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
B.Sc (All Major Branches) Lecture Notes
job detailsMaths / Statistics Lecture Notes
job detailsPhysics Lecture Notes
job detailsChemistry Lecture Notes
job detailsElectronics Lecture Notes
job detailsComputer Science/IT Lecture Notes
job detailsAgriculture Lecture Notes
job detailsBiotechnology/Biomedical Lecture Notes
job detailsNursing Lecture Notes
job detailsFashion Technology Lecture Notes
M.Sc (All Major Branches) Lecture Notes
job detailsComputer Science/IT Lecture Notes
job detailsAgriculture Lecture Notes
job detailsBiotechnology/Biomedical Lecture Notes
job detailsNursing Lecture Notes
job detailsFashion Technology Lecture Notes
job detailsMaths / Statistics Lecture Notes
job detailsPhysics Lecture Notes
job detailsChemistry Lecture Notes
job detailsElectronics Lecture Notes
B.Com/M.Com Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsLab Manuals
job detailsCommerce Placement Materials
job detailsCommerce Placement Materials
BBA Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsLab Manuals
job detailsPlacement MaterialsEighth Semester Lecture Notes
job detailsFresher Jobs Details
BCA Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsLab Manuals
job detailsPlacement Materials
job detailsFresher Jobs Details

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright All rights are reserved to technicalsymposium.com