Ajax interview questions

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

Answer:Ajax is a form of JavaScript, which uses XML Http Request objects that take action event parameters into a method called“open.”The term AJAX symbolizes Asynchronous Java script and XML, wherein there is no order in which the requests and responses are tracked.“XMLHttpRequest.open” takes action events as URL Parameters. On the other hand, “XMLHttp Request.send” sends the Request object either asynchronously or synchronously, depending on whether the option for the synchronous version is true or false.

Q2. What is AJAX?


AJAX symbolizes Asynchronous JavaScript and XML. It is often used for allowing the client side of an application to communicate with the server side of the application. Before the formation of AJAX, this feat was impossible.

Q3.Can you list some examples of AJAX-based applications?


Some applications and scenarios in which AJAX is utilized include login forms, auto-complete (e.g.Google search ), voting and rating systems, updating with user content, form submission andvalidation, chat rooms and instant messaging, Slicker UIs, external widgets, light-boxes (as opposed to pop-ups), and Flash (e.g. Flash games).

Q4. Is AJAX a browser-dependent or a browser-independent script?


AJAX is a browser-dependent technology. The Ajax engine runs on Firefox, Opera 8, Safari and later Mozilla builds, and theMicrosoft ActiveX object.

Q5. Describe the Animation Extender control and the method by which this control is utilized.


The Animation Extender control permits you to program fluid animations to the controls that you put on the page. This control allows you to program elements that can move around the page based upon specific end user triggers (such as a button click). There are specific events available against which to program your animations. These events include “OnClick,” “OnHoverOver,” “OnHoverOut,” “OnLoad,” “OnMouseOver,” and “OnMouseOut,” which are to be constructed as:

<ajaxtoolkit:AnimationExtender id=”ani” targetcontrolid=”anipanel” runat=”server”>

<asp:panel id=”anipanel” runat=”server”>


Q6. Does Load Runner support AJAX Apps?


Load Runner supports AJAX Apps. However, Ajax protocols in Load Runner are not as efficient as they are in HTTP. Yet, using HTTP to record AJAX web requires copious custom coding. AJAX protocols heavily depend on memory, and running more than 2GB of ram could cause the machine to freeze.

Q7. Describe the process and benefits of using theAlways Visible Control Extender.


The Always Visible Control Extender authorizes a control to be pinned to a particular location. For example,when a control has been permanently set to be present at the left corner of the page, the control will be so in the prescribed left and right co-ordinates. This placement will apply, whenever the page is resized or scrolled.

Q8. Whatare synchronous and asynchronous AJAX requests?


During the initiation of synchronous requests, the script desists and awaits a reply from the server before proceeding; but during the initiation of asynchronous requests, the script sanctions the procession of the page and handles the reply.


Q9. How we can send more values through the response text?


We can send text values with the concatenation of ‘|’ operator andby splitting with the pipe operator like’responseText.split(‘|’);’ If done properly, wewouldreceive an array of our text. Now, we can access it, or we can use JSON to send multiple text values in a array format.

Q10.What is the predominant distinction between JavaScript and J-query?


JavaScript is a language,while J-query is merely a library written using JavaScript. This library is light-weight, cross-browser compatible, and simple. One can also assert that J-query is a plugin used to build function.

Q11. When should we use a Java applet instead of AJAX?


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 applet can communicate to JavaScript using the Live-Connect APIs. One should not ask: “should we use AJAX or applets?”Instead, one should discover which technology best fits your needs. In summary, AJAX and applets need not be mutually exclusive

Q12. What is the difference between a destructor and a garbage collector?


A destructor is a special member function of a class called as soon as an object is de-allocated, whilea garbage collector is either a program or an application that de-allocates the memory of a formerly unreachable object.

Q13. Which URL should I include in my Site map?


Your Sitemap should include the version that you prefer displayed in search results, so it should be http://www.example.com/ajax.html#!foo=123.

Q14. What browsers support AJAX?


Nearly all browsers do, but common supportersinclude Internet Explorer 5.0 and up, Opera 7.6 and up, Netscape 7.1 and up, Firefox 1.0 and up, and Safari 1.2 and up, among others.

Q15. Are Ajax applications easier to develop than traditional web applications?


Not necessarily; AJAX applications inevitably run complex JavaScript codes 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 one meet this challenge.

Q16. Do AJAX applications always deliver a better experience than that delivered by a traditional web application?


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 AJAXonly to enhance the user experience of our applications.

Leave a Reply

Your email address will not be published.