Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/03/2006, 13:52
sanref
 
Fecha de Ingreso: mayo-2004
Mensajes: 189
Antigüedad: 20 años
Puntos: 1
ahi va....

Me deberia devolver un xml simple con un valor, con el cual yo se si el eusuario es valido o no. No funciona en Firefox, en todos los demas anda perfecto.

ahi va el codigo

Código:
function nuevoAjax(){
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 cargarContenido(){
	var t1, t2, res, funcion, valor;
	ajax = nuevoAjax();
	ajax.open("POST", "verificar_usuario.asp",false);
	//hasta aqui llega, despues no sigue mas
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			res  = ajax.responseXML.documentElement;
			funcion = res.getElementsByTagName('funcion')[0].firstChild.data;
			valor = res.getElementsByTagName('valor')[0].firstChild.data;
			
		             eval(funcion + '(valor)');
		}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("usuario=" + document.form1.usuario.value + "&pass=" + document.form1.pass.value + "&campus=" + document.form1.campus.value);
}
window.onload= function(){cargarContenido()}

Saludos y gracias a los q se interesan....