C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




what is the answer?


Posted Date: 29 Aug 2008      Total Responses: 1

Posted By: Ravi Kiran.T       Member Level: Gold     Points: 1


function getXHRObject(){
var req = null;
if(window.XMLHttpRequest){
req = new XMLHttpRequest();
}
else if(window.ActiveXObject){
req = new ActiveXObject("Microsoft.XMLHTTP");
}
return req;
}
function performRequest(){
var xhr = getXHRObject();
xhr.open("GET","test.xml",false);
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
alert(xhr.responseXML);
}
}
xhr.send(null);
}

Assume test.xml is properly formed and sent with the correct mime type.
Referring to the code and statement above, which one of the following occurs when the method performRequest is executed in Microsoft IE?

Options:

Choice 1
It throws an error since you cannot request an xml file directly.

Choice 2
An alert statement appears with [object] in it.(checked)

Choice 3
An alert statement appears with the XML file's text in it.

Choice 4
No alert appears since requesting a file returns a status code of zero.
Choice 5
No alert appears since onreadystatechange does not execute.




Responses

Author: Pradeep Kumar Chaudhary    29 Aug 2008Member Level: GoldRating:     Points: 2
Choice 4
No alert appears since requesting a file returns a status code of zero.
This is the right answer.


Post Reply
You must Sign In to post a response.
Next : Athira appukuttan ????
Previous : Interview Question
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

SPOC

Contact Us    Privacy Policy    Terms Of Use