Tengo un script en ajax que cuando lo ejecuto en IE me marca este error
Detalles de error de página web
Mensaje: El dato necesario para completar esta operación no está disponible todavía.
Línea: 46
Carácter: 44
Código: 0
URI:
xxxxxxxxxxxxxxxxx/ajax_cambia.js
donde la linea 46:
xmlHttp.onreadystatechange=function() { stateChanged( xmlHttp.responseText, caja); }
Código Javascript
:
Ver originalfunction GetXmlHttpObject(handler)
{
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
function stateChanged(proceso, caja)
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
// document.getElementById(caja).innerHTML= xmlHttp.responseText;
document.getElementById(caja).innerHTML=proceso
}
else {
//alert(xmlHttp.status);
document.getElementById(caja).innerHTML = '<div style="width:16px; margin:auto"><img src="images/ajax-loader.gif" width="16" height="16"></div>';
}
}
// Will populate data based on input
function htmlData(url, caja, qStr)
{
if (url.length==0)
{
document.getElementById(caja).innerHTML="";
return;
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Su navegador no soporta este tipo de procedimiento, por favor actualice el mismo.");
return;
}
url=url+"?"+qStr;
url=url+"&sid="+Math.random();
// xmlHttp.onreadystatechange=stateChanged;
xmlHttp.onreadystatechange=function() { stateChanged( xmlHttp.responseText, caja); }
xmlHttp.open("GET",url,true) ;
xmlHttp.send(null);
}