Tolal:52 Click:
1
2 3
Ajax Interview Questions And Answers
Page 1
Ques: 1 Which Protocol is used by Web service and Web service consumer to communicate with each other ?
Ans:
HTTP
Ans:
soap
Ans:
SOAP
Ans:
SOAP
Ans:
HTTP
Ans:
SOAP
Ans:
http
Ans:
SOAP
Ans:
SOAP
Ques: 2 Why we use SOAP?
Ans:
transfer the data
Ques: 3 Do Ajax applications always deliver a better experience than traditional web applications?
Ans:
Ajax made interaction designers more flexibility. However, the more power we have, the more caution we must use in exercising it. You should careful when you use Ajax to enhance the client experience of our applications.
Ques: 4 How to send an image using Ajax?
Ans:
Yes, you can send an image with Ajax.
Like that Google Maps.As per Ajax request Urls of images send as the response and we can set those URLs using DHTML.
Example:
Tn this example an XML document is returned from an AJAX.
<categories>
<category>
<cat-id>001</cat-id>
<name>IT</name>
<description>Improve your skill</description>
<image-url>IT_image.gif</image-url>
</category>
<category>
<cat-id>002</cat-id>
<name>Mathematics</name>
<description>Solve problem easily</description>
<image-url>mathematics.gif</image-url>
</category>
</categories>
We use image-url element to contain the location of the URL.The callback method that we used in AJAX interaction will parse the response XML document and call the addCategory function.
The addCategory function looks up a table row element "categoryTable" in body of the page and adds a row to the element that is use to 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>
source of the image is set to the image source. And we can load the image using a subsequent HTTP request for the image at the URL. "images/IT_image.gif"
or
"images/Mathematics.gif"
This will occur when you add the image in the categoryTable.
Ques: 5 Explain about security of the Ajax based web applications?
Ans:
We want to confirm that XMLHttpRequest object is subjected to the browsers security sandbox.When we requested about resources by the XMLHttpRequest object and it must reside within the same domain from which the calling script originated from which the calling script requested.
In XMLHttpRequest we can't requested for services due to security restriction,outside the domain(from which the script was originally served).
Ques: 6 Explain the disadvantage of Ajax.Which related to browser integration?
Ans:
When we created dynamic pages using Ajax than these pages doesn't back button(we use this button to go on previous pages.
There are many ways to solve above problem.I have given you one of the best method called iframe to solve this problem. We can also bookmark a certain application in its state. Because User can also maintain the applications as changes the state of application.
Ques: 7 Tell me about Ajax component frameworks provides?
Ans:
I have given you some features that are provided by ajax component frameworks.These features are:
1.Cusomization Applications
2.skinning facilities
3.extensibility
4.programmatic control.
Above these functions are a bit slower in execution(with less control).
Ques: 8 Tell me about direct ajax frameworks?
Ans:
If you want to use direct Ajax frameworks, Than you must require CSS, HTML and Ajax expertise. We should done authoring in HTML and the Ajax framework will deals with HTML elements directly . Ajax provide us many frameworks and API`s for many purposes like that commonly including functions(COM), event handling, DOM, and altering graphic rich elements.
We can use these frameworks for shopping frameworks, But don't use this framework for applications which are based on web.
Ques: 9 Tell me about multimedia functions of Ajax?
Ans:
Basically, Ajax has no facility of build-in multimedia function But it it can uses functionality of other browsers and plugin`s such as SVG, Quicktime and flash pugin.We can achieve multimedia in Ajax through mashup and hack. Multimedia functions are help us to build excellent application. We can obtain these multimedia functions from outside.
Ques: 10 Explain how Ajax is friendly with SEO?
Ans:
Because Ajax is a combination of many languages like: JavaScript,CSS etc. I have given you reason why Ajax is not so freindly with search engine indexing because much part of its code are written in JavaScript. So,Ajax may occur some problem websites have present dynamic data present.Generally, Search engines generally not to use index Javascript present in web pages.
Ques: 11 Explain about the Response time when we are using Ajax?
Ans:
Response time: We can also known response time as latency.WE can dscribe response time as the interval between the time taken to process the request generated from the client on the server. Delay has been come when proper handling of the XMLHttprequestobject occour between the client and server request.
Ques: 12 Tell me reason of using HTTP POST request by Ajax requests?
Ans:
Suppose that if you want to check whether an email address xyz@abc.com is used already or not with Ajax,because url doesn't supports character "@" in email addresses directly.so, we have to use HTTP POST.
Ques: 13 What Ajax framework do you recommend for PHP applications?
Ans:
Prototype
Ans:
Prototype
Ques: 14 How to handle te concurrent Ajax request?
Ans:
You can process more than one AJAX request process at a single time with using JavaScript. In proper post processing of code it is recommended that you use JavaScript Closures.
I have given you example that shows an we can abstract XMLHttpRequest object by a JavaScript object called AJAXInteraction.
When you pass argument in the URL to call and the function to call when completing the processing.
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("Post Processing is going
on");});
ai.doGet();
}
Above we use function to makeRequest() to create an AJAXInteraction with a URL to of "processme" and their is an inline function which is use to show alert dialog with the message "Post Processing is going on".
When we called ai.doGet() function than the Ajax interaction is initiated and when server-side component mapped to the URL "processme" returns a document and we passed them to the callback function that was specified when the Ajax Interaction was created.We use callback function that is associated with a specific AJAX interaction.When we 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.We can made concurrently with the limited number of requests. In internet explorer at any given time allows for two concurrent Ajax requests. Generally,In case of other browsers we can allow more than three and five requests.
Keep in mind when you making multiple AJAX calls from the client than their is no guaranty to return rspose at given order.
Ques: 15 How I create my own AJAX functionality?
Ans:
If you want to create your own Ajax functionality means not want to reuse an existing Ajax component than you have to know about that I have given below.
You should have to know Dynamic HyperText Markup Language(DHTML) because DHTML technology we used in foundation for AJAX. Because DHTML can enable 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: It is an loosly typed scripting language.It is an object based scripting language which is supported by all major browsers and it is essential for AJAX interactions.
JavaScript of a page performs when page is being loaded and when an event occour than associated JavaScript will called.Example: a mouse click, or a key press in a form element.
DOM: It is an API for accessing and manipulating structured documents.Basically DOM is used to represent the structure of XML and HTML documents.
CSS: Using CSS we can presents the page in different manner via present each like: fonts, colors, sizes, and position in different style. Using CSS we can allow for a clear separation of the presentation from the content and may be changed programmatically by JavaScript.
You should also have deep Understanding the basic request/response nature of HTTP.
If you ignore the differences between the GET and OIst methods than many subtle bugs can result when configuring an XMLHttpRequest and HTTP response codes when processing callbacks.
JavaScript: It is an client-side paste, in a sense.We use JavaScript to create the XMLHttpRequest Object and trigger the asynchronous call.It is also used to parse the returned content. Using JavaScript we can analyze the returned data and process returned messages. We use JavaScript to inject the new content into HTML page using the DOM API and use to modify the CSS.
Ques: 16 Write down different framework available in Ajax?
Ans:
For getting detailed information we have an available frame called Prototype.JS Framework.To handle Ajax and JavaScript is very easily and to use of concept of $ is very easily also.
In Ajax their is no need to check cross browser, Open, Close and error handling through traditional Ajax.
Ques: 17 What are the limitations of Ajax?
Ans:
Mainly Ajax is an client/server technology.In Ajax in the web client node does run run on server typically that react to HTTP GET and POST requests.Becuase clients can't communicate each other directly.
1.Using Ajax we can develop an distributed application developed which helps a central web server system to manage requests between clients. In this Client 1 can generate events/data for and can respond to events/data from Client 2.
Using we can connect both to a common web server to help in communication.
2.Ajax is an slow or unreliable network connections.Because in case of traditional web applications that are required a full round-trip to the server may slowly for end users but we can predict them.Generally, end users would intuitively know they can have performed an action like that, submitting a form or clicking a link, and must to wait for a server to respond. When we use Ajax user amy have less intuition about reason of result waiting for a server response occours because of which type of events.
connections may reduce usability if not carefully designed to accommodate both fast and slow network characteristics.
Ques: 18 What is the back ground work going on when you type www.R4R.co.in in your web browser?
Ans:
I have given you steps that was processed on back ground when you type www.R4R.co.in in web browser:
Step1: In the first step browser sends a DNS request to the DNS server to resolve the name www.R4R.co.in.The DNS request may be a TCP or UDP request to the DNS server.
Step2: When IP address is recieved, the browser makes a socket connection with that IP Adress and port 80.
Step3: Now, a Http GET request is fired by the browser on that socket connection and when the response starts coming it parses it and it will shows on the screen.
Step4: Note depending on the content of the first response,multiple sockets might be open to fetch embedded images and objects in the same page.
Ques: 19 What is the main difference b/w Ajax and JavaScript?
Ans:
Their is not much more difference between Ajax and JavaScript.Because Ajax is an "Asynchronous Javascript And XML".
We can say that it is an new approach of reloading page.
Using Ajax we can send an request to the server and reload the part of page every time.Ajax perform their task via to send an XMLHttpRequest to the server and fetch result according to the request.
Using Ajax we can send an multiple request from the same page with reloading the requested part of the page.
Ques: 20 What's the main purpose of Ajax?
Ans:
AJAX stands for Asynchronous Javascript and XML.
Ajax provide us some useful features like that Using Ajax we can refresh the some part of page rather than refresh the whole page. Means that using Ajax we can decrease the load on server and incease its performance.
'or'
Using Ajax we can refreshed asynchronously and to fetch information or response from server according to the client request.than we decrease the no of interaction of client to the server every time.
Goto Page:
1
2 3
Ajax Objective
Ajax Objective Questions And Answers
Ajax Interview Questions And Answers
Ajax Subjective Questions And Answers
R4R,Ajax Objective, Ajax Subjective, Ajax Interview Questions And Answers,Ajax,Ajax Interview,Ajax Questions ,Ajax Answers