Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/06/2007, 10:16
maygreth
 
Fecha de Ingreso: enero-2006
Mensajes: 21
Antigüedad: 18 años, 3 meses
Puntos: 0
Problemas con ajax y IE

Hola que tal como estan.

Estoy haciendo una aplicación con ajax, y me funciona correctamente en Firefox y Opera pero con Internet Explorer no, generando el siguiente error

"Error desconocido en tiempo de ejecución" en la línea "document.getElementById("sub_3").innerHTML = ajax.responseText"

aqui les envío mis funciones:

function nuevoAjax(){
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (E) {
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
}
return xmlhttp;
}

function cargarContenido(valor){
contenedor = document.getElementById(contenido);
ajax=nuevoAjax();
ajax.open("GET", "msubcat.php?indice="+valor,true);
ajax.onreadystatechange=function() {
if (ajax.readyState==4) {
contenedor.innerHTML = ajax.responseText
}
}
ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajax.send(null);
}

Las letras en rojo indica que es la linea donde se produce el error. espero puedan ayudarme.

Mil gracias
Ana Azuaje.