Interviewer And Interviewee Guide

XMLHttpRequest Interview Question:

How do I get the XMLHttpRequest object?

Submitted by: Muhammad
Depending upon the browser...

if (window.ActiveXObject) {
// Internet Explorer
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
else if...


if(window.XMLHttpRequest)
{
xmlhttpobj=new XMLHttpRequest();
return xmlhttpobj;

}
else
{
try
{

xmlhttpobj=new ActiveXObject("Microsoft.XMLHTTP");
}catch(e)
{
xmlhttpobj=new ActiveXObject("Msxml2.XMLHTTP");
}
}
}
Submitted by: Muhammad

Read Online XMLHttpRequest Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.