Foros del Web » Programando para Internet » Javascript » Frameworks JS »

Un error en IE al cargar AJAXs

Estas en el tema de Un error en IE al cargar AJAXs en el foro de Frameworks JS en Foros del Web. 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 ...
  #1 (permalink)  
Antiguo 11/03/2010, 19:22
Avatar de sjam7  
Fecha de Ingreso: diciembre-2001
Ubicación: Guadalajara, Mexico
Mensajes: 3.672
Antigüedad: 22 años, 4 meses
Puntos: 16
Un error en IE al cargar AJAXs

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 original
  1. function GetXmlHttpObject(handler)
  2. {
  3.    var objXMLHttp=null
  4.    if (window.XMLHttpRequest)
  5.    {
  6.        objXMLHttp=new XMLHttpRequest()
  7.    }
  8.    else if (window.ActiveXObject)
  9.    {
  10.        objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
  11.    }
  12.    return objXMLHttp
  13. }
  14.  
  15. function stateChanged(proceso, caja)
  16. {
  17.    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  18.    {
  19. //    document.getElementById(caja).innerHTML= xmlHttp.responseText;
  20.     document.getElementById(caja).innerHTML=proceso
  21.    }
  22.    else {
  23.      //alert(xmlHttp.status);
  24.      document.getElementById(caja).innerHTML = '<div style="width:16px; margin:auto"><img src="images/ajax-loader.gif" width="16" height="16"></div>';
  25.    }
  26. }
  27.  
  28. // Will populate data based on input
  29. function htmlData(url, caja, qStr)
  30. {
  31.    if (url.length==0)
  32.    {
  33.        document.getElementById(caja).innerHTML="";
  34.        return;
  35.    }
  36.    xmlHttp=GetXmlHttpObject()
  37.    if (xmlHttp==null)
  38.    {
  39.        alert ("Su navegador no soporta este tipo de procedimiento, por favor actualice el mismo.");
  40.        return;
  41.    }
  42.    
  43.    url=url+"?"+qStr;
  44.    url=url+"&sid="+Math.random();
  45. //   xmlHttp.onreadystatechange=stateChanged;
  46.    xmlHttp.onreadystatechange=function() { stateChanged( xmlHttp.responseText, caja); }
  47.    
  48.    xmlHttp.open("GET",url,true) ;
  49.    xmlHttp.send(null);
  50. }

Etiquetas: ajax
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:22.