AJAX Interview Questions and Answers

Top 30 AJAX Interview Questions and Answers – Technosap

AJAX 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.  If you have finally found your dream job in AJAX but some guys are wondering how to crack the AJAX Interview Questions and what could be the probable AJAX Interview Questions and Answers.  We have designed the most common AJAX Interview Questions and Answers to help you get success in your interview.

Below are the Best AJAX Interview Questions and Answers that are mostly asked in an interview these interview questions are simple for beginners and professionals.

Top 30 AJAX Interview Questions and Answers

1), What’s 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.

2), 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.

3), 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 AJA 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.

4), 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 what’s left to be done.

5), 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.

6), 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 XIVIL (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.

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

8),  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

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

10), 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+

11), 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 support AJAX.

12), 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.getWriterawrite(“<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.

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

Proxied calls are made through stub objects that mimic your PHP classes on the JavaScript side in AJAX. 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() in AJAX.


14), What is the minimum version of PHP that needs to be running in order to use HTML AJAX?

The oldest PHP version we’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.)

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

16), What JavaScript libraries and frameworks are available for AJAX support?

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.

17), 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.

18), 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.

19), 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.

20), How Ajax is Different?

An Ajax application eliminates the start-stop-start-stop nature of interaction on the Web by introducing an intermediary — an Ajax engine — between the user and the server. It seems like adding a layer to the application would make it less responsive, but the opposite is true.

Instead of loading a webpage, at the start of the session, the browser loads an Ajax engine —written in JavaScript and usually tucked away in a hidden frame. This engine is responsible for both rendering the interface the user sees and communicating with the server on the user’s behalf The Ajax engine allows the user’s interaction with the application to happen asynchronously independent of communication with the server. So the user is never staring at  a blank browser window and an hourglass icon, waiting around for the server to do something.

21), How do we abort the current XMLHttpRequest in AJAX?

Just call the abort() method on the request to abort the current XIVILHttpRequest in AJAX.

22), 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 executed 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.

23), How do we 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.

24), 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.

25), How do I test my AJAX code?

There is a port of JUnit for client-side JavaScript called JsUnit used to test AJAX code.

26), 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.

27), Does Ajax have significant accessibility or browser compatibility limitations?

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.

28), 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.

29), 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 continuously 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.

30), 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 Flicker, which uses both).

However, I opened here that this post will be highly beneficial for who are stepping towards their career as Ajax professional especially for those who are still fresher’s. Moreover, in this post I have also listed some useful AJAX Interview Questions and Answers for experienced professionals that will definitely help them to grab their dream job and offer a great opportunity to add sparkles in their career.

Online Training Tutorials

  • MySQL Interview Questions and AnswersMySQL Interview Questions and AnswersMySQL is a relatively recent entrant into the well-established area of relational database management systems (RDBMs), a concept invented by IBM researcher Edgar Frank Codd in 1970. […]
  • SAP system developmentTo Understand essential aspects of SAP System developmentThis article describes the essential aspects of SAP system development. The resources and materials will be abundant like a sea, but the sole purpose of this writing is to give bullet […]
  • create cost centerHow to Create Cost Center in SAP?Every one ant to know How to Create Cost Center in SAP?. The answer Cost Centre are used to track where cost occur in the organization. As costs are incurred, they are assigned or posted […]
  • Display Fibonacci SequenceC Program to Display Fibonacci SequenceTo Write a program that would to Display Fibonacci Sequence. The C program to display Fibonacci Sequence using loops is given in below simple example. Unlike for and while loops, which […]
  • C Program to Find Total of Even IntegersC Libraries – Quick GuideEveryone knows core of the C language is small and very simple to use, and special functionality is provided in the form of libraries of ready-made functions. Some of C libraries are […]
  • List of Stock ValuesList of Stock Values Balances Transaction Code MB5LSAP transaction MB5L (List of Stock Values: Balances) is classified in the Materials Management module under application component Inventory Management and runs Application development R/3 […]
  • idoc in SAPWhat is idoc in SAP?Standard SAP IDoc interface uses ALE as the transfer mechanism and workflow functionality is used to route a failed IDOC to a specific individual or workgroup. Business data is […]
  • SAP Installation GuideSAP Installation Guide Step by Step for Begineerswe here with share the sap installation step by step procedure for easy downloadable and installation of SAP. SAP Installation Step by Step Guide Download the Installation Guide […]