Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/09/2007, 04:21
Agrey
 
Fecha de Ingreso: octubre-2003
Mensajes: 364
Antigüedad: 20 años, 6 meses
Puntos: 1
Ajax y firefox

Hola tengo una web que carga datos mediante ajax. La web funciona correctamente en IE pero no asi en FIREFOX.

He estado buscando pero no encuentro la solución.

Mi código es el siguiente:

Código:
function objetoAjax(){
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
  		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}


function mostrar(id){
	ajax=objetoAjax();	
	divResultado = document.getElementById('light');
	ajax.open('get', 'mostrar.php?id='+id,false);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			divResultado.innerHTML=ajax.responseText;			
		}
	}
	ajax.send(null)
}

Última edición por Agrey; 17/09/2007 a las 04:31