segunda-feira, 9 de junho de 2008

ajaxInit()

Função que retorna um objeto XMLHttpRequest usado para páginas que usam Ajax.

function ajaxInit()
{
var xmlhttp;

try
{
xmlhttp = new XMLHttpRequest();
}
catch(ee)
{
try
{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
xmlhttp = newActiveXObject("Microsoft.XMLHTTP");
}
catch(E)
{
xmlhttp = false;
}
}
}

return xmlhttp;
}

Nenhum comentário: