:: Home

  login:         
  passwords:  

Ajax Interview Questions and answers [Part 4]

The General Ajax Interview Questions consists the most frequently asked questions in Ajax. This list of 100+ questions guage your familiarity with the Ajax platform. The q&a have been collected over a period of time from various blogs, forums and other similar Php sites

4. Ajax Interview Questions Part[4]

   4.1 Is the XMLHttpRequest object part of a W3C standard?
   4.2 What kinds of applications is Ajax best suited for?
   4.3 Does this mean Adaptive Path is anti-Flash?
   4.4 Where can I find examples of AJAX?
   4.5 What is the XMLHttpRequest object?
   4.6 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?
   4.7 How do I access data from other domains to create a mashup with Java?
   4.8 Does Java have support for Comet style server-side push?
   4.9 Is the XMLHttpRequest object part of a W3C standard?
   4.10 What AJAX framework do you recommend for PHP applications?
   4.11 What are the different frameworks available In AJAX.
    4.12 Why can/should AJAX be used?
   4.13 Describe the formats and protocols used/specified by AJAX
   4.14 Describe some things that can't be done with AJAX
   4.15 How should AJAX objects be created?
   4.16 For what error conditions should programs check?
   4.17 Are Finite State Machines (FSM's) appropriate for use with AJAX?
   4.18 Identify and describe the state transitions that can/should occur within a transaction
   4.19 What values exists for the XmlHttpRequest.readyState field, and what do they mean?
   4.20 When is it appropriate to access, or use the other fields within the XmlHttpRequest object?

4.1 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.


4.2 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.


4.3 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).


4.4 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...


4.5 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.


4.6 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.


4.7 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.


4.8 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.


4.9 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.


4.10 What AJAX framework do you recommend for PHP applications?

SAjax, NAjax, FAjax.All of them are ok, but it it best to make your own to suit your needs. What AJAX framework do you recommend for PHP applications? Answer SAjax, NAjax, FAjax.All of them are ok, but it it best to make your own to suit your needs.


4.11 Is AJAX a programming language?

No.


4.12 Why 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.


4.13 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 responce should also be provided.


4.14 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.


4.15 : How should AJAX objects be created?

In a browser general manner, if at all possible.


4.16 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.


4.17 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.


4.18 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


4.19 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


4.20 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.

::  Home :: Services ::  Prices ::  Request Quote
Copyright 2007, Megasolutions Ltd