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:
Código :
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) { [color=red]contenedor.innerHTML = ajax.responseText[/color] } } 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.