Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/02/2009, 06:56
Avatar de farra
farra
 
Fecha de Ingreso: marzo-2008
Ubicación: Aqui estoy
Mensajes: 574
Antigüedad: 16 años, 2 meses
Puntos: 20
Pregunta Error: lenght required

Código:
function toggle(what) {
        var aobj = document.getElementById(what);
        if( aobj.style.display == 'none' ) {
               aobj.style.display = '';
        } else {
               aobj.style.display = 'none';
        }
}
function CrearXMLHttp(){
	XMLHTTP=false;
	if(window.XMLHttpRequest){
		return new XMLHttpRequest();
	}else if(window.ActiveXObject){
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
}
// suponiendo que tu div se llama loading
function OpenPage(url,id,loading){
//alert(url+' '+id);
	req=CrearXMLHttp();
	if(req){
		req.onreadystatechange = function() { manejador(id,loading); }; // aca cambie
		req.open("POST",url,true);
		req.send(null);
                toggle(loading); // ojo aqui
	}
}
function manejador(id,loading){
	if(req.readyState == 4){
		if(req.status == 200){
                        toggle(loading); // ojo aca
			document.getElementById(id).innerHTML=req.responseText;
		}else{
			alert("Error"+req.statusText)
		}
	}
}
llamada:
Código:
OpenPage('pagina.php','contenedor','cargando');


tengo un problema con esta funcion de ajax....

cuando abro en explorer, opera, safari, y chrome funciona perfecto, pero al utilizar con mozilla firefox no me funciona...

me tira un alert que dice "Errorlenght required"

a que puede deberse esto?
__________________
Firma:
Es mas dificil para el mono entender que el hombre desciende de el....

PD: Siempre doy karma al que me da una buena respuesta... ;0)