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

ayuda con ajax en ie

Estas en el tema de ayuda con ajax en ie en el foro de Frameworks JS en Foros del Web. hola amigos tengo un archivo ajax en donde en mozilla y googlechrome me funciona bien pero en internet explorer no c que pasa. les agradesco ...
  #1 (permalink)  
Antiguo 04/07/2010, 20:37
Avatar de ronnyra  
Fecha de Ingreso: diciembre-2009
Mensajes: 173
Antigüedad: 14 años, 5 meses
Puntos: 1
ayuda con ajax en ie

hola amigos tengo un archivo ajax en donde en mozilla y googlechrome me funciona bien pero en internet explorer no c que pasa.

les agradesco su ayuda, aqui les dejo el archivo el depurador de ie me muestra error en esta parte
Código Javascript:
Ver original
  1. res.innerHTML = ajax.responseText

Código Javascript:
Ver original
  1. function nuevoAjax()
  2. {
  3.     /* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por
  4.     lo que se puede copiar tal como esta aqui */
  5.     var xmlhttp=false;
  6.     try
  7.     {
  8.         // Creacion del objeto AJAX para navegadores no IE
  9.         xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
  10.     }
  11.     catch(e)
  12.     {
  13.         try
  14.         {
  15.             // Creacion del objet AJAX para IE
  16.             xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  17.         }
  18.         catch(E)
  19.         {
  20.             if (!xmlhttp && typeof XMLHttpRequest!='undefined') xmlhttp=new XMLHttpRequest();
  21.         }
  22.     }
  23.     return xmlhttp;
  24. }
  25.  
  26.  
  27.  
  28. function buscarDato(){
  29.    
  30.     bus = document.getElementById('dato').value;   
  31.     res = document.getElementById('resultado');
  32.     ajax=nuevoAjax();
  33.     ajax.open("POST", "bus_inscrip.php",true);
  34.     ajax.onreadystatechange=function() {
  35.         if (ajax.readyState==4) {
  36.             res.innerHTML = ajax.responseText
  37.             }
  38.     }
  39.      ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  40.     ajax.send("busqueda="+bus)
  41.  
  42. }
  #2 (permalink)  
Antiguo 05/07/2010, 04:46
Avatar de Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 17 años, 4 meses
Puntos: 126
Respuesta: ayuda con ajax en ie

Hola

El problema ha de estar al crear el objeto xmlhttprequest
Código Javascript:
Ver original
  1. function creaAjax(){
  2. var ajaxs = ["Msxml2.XMLHTTP","Msxml2.XMLHTTP.4.0","Msxml2.XMLH TTP.5.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"];
  3. var ajax = false;
  4.     for(var i=0 ; !ajax && i<ajaxs.length ; i++){
  5.         try{
  6.             ajax = new ActiveXObject(ajaxs[i]);
  7.         }
  8.         catch(e) {
  9.             ajax = false;
  10.         }
  11.     }
  12.     if(!ajax && typeof XMLHttpRequest!='undefined') {
  13.         ajax = new XMLHttpRequest();
  14.     }
  15.     return ajax;
  16. }
Suerte
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />
  #3 (permalink)  
Antiguo 06/07/2010, 14:55
Avatar de ronnyra  
Fecha de Ingreso: diciembre-2009
Mensajes: 173
Antigüedad: 14 años, 5 meses
Puntos: 1
Respuesta: ayuda con ajax en ie

amigo pero el error no me lo esta mostrando ahi en el crear ajax si no en la funcion buscardato()
en esta linea de codigo.

res.innerHTML = ajax.responseText

porfa revisa bien y ayudame con eso gracias....
  #4 (permalink)  
Antiguo 07/07/2010, 16:14
Avatar de LuZBinG  
Fecha de Ingreso: enero-2008
Mensajes: 407
Antigüedad: 16 años, 3 meses
Puntos: 5
Respuesta: ayuda con ajax en ie

que error te sale???

sera un error desconocido tiempo de ejecucion???
__________________
LuZbIng
  #5 (permalink)  
Antiguo 08/07/2010, 11:09
 
Fecha de Ingreso: julio-2010
Mensajes: 14
Antigüedad: 13 años, 9 meses
Puntos: 1
Respuesta: ayuda con ajax en ie

usen jquery y dejense de broncas es lo mejor que existe

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 15:09.