Naveen P.N

Just another Blog to play with programming

Initializing XMLHttpRequest Object

leave a comment »

This is the standard way of initializing XMLHttpRequest Object

XMLHttp-Initialize.js

var xhr;
if(window.ActiveXObject)
{
try
{

xhr = new ActiveXObject(“Microsoft.XMLHTTP”);

}
catch (e)
{
xhr = false;
}

}
else
{
try
{
xhr = new XMLHttpRequest();
}

catch (e)
{
xhr = false;
}
}

Download Code

Written by Naveen P.N

April 29, 2009 at 5:08 am

Posted in AJAX

Leave a Reply