 
			
				16/07/2009, 00:15
			
			
			     |  
      |    |    |    Fecha de Ingreso: mayo-2003  
						Mensajes: 55
					  Antigüedad: 22 años, 5 meses Puntos: 1     |        |  
  |      Respuesta: Ajax en mi lan desde internet        Hola, parece que de la noche a la mañana a empezado a funcionar bien con los scripts que tenía. De todas maneras y en señal de agradecimiento este es uno de los códigos que utilizo para Ajax:   
// INICIO SCRIPTS AJAX 
function getXMLHTTPRequest() { 
try { 
req = new XMLHttpRequest(); 
} catch(err1) { 
  try { 
  req = new ActiveXObject("Msxml2.XMLHTTP"); 
  } catch (err2) { 
    try { 
    req = new ActiveXObject("Microsoft.XMLHTTP"); 
    } catch (err3) { 
      req = false; 
    } 
  } 
} 
return req; 
}   
var http = getXMLHTTPRequest();       
// INICIO DEL BLOQUE PARA COMPROBAR CLAVE Y VALIDAR DATOS   
function CambiarPss() { 
	id = document.getElementById('usu_id1').value; 
	c1 = document.getElementById('clave_nueva1').value; 
	var myurl = 'aj_cambiarclaveoperario.php'; 
	myRand = parseInt(Math.random()*999999999999999); 
	var modurl = myurl+"?rand="+myRand+"&id="+id+"&clave="+c1; 
	http.open("GET", modurl, true); 
	http.onreadystatechange = Respuesta_CambiarPss; 
	http.send(null); 
}   
function Respuesta_CambiarPss() { 
	//document.getElementById('canvas').style.visibility  ='visible'; 
	if (http.readyState == 4) 
		{ 
		if(http.status == 200) 
			{   
				document.getElementById('loading_canvas').style.vi  sibility='hidden'; //Ocultamos la capa de carga 
				ca = document.getElementById('clave_actual1').value; 
				retorno = this.responseXML.getElementsByTagName("retorno")[0].childNodes[0].nodeValue;  
				if(retorno == 1) 
					{ 
					//La clave proporcionada es correcta 
						alert("OK: la clave se ha cambiado correctamente");     
					} 
					else 
					{ 
					//Ha habido un error al cambiar la clave 
						alert("MAL: ha habido un problema al cambiar la clave. Es necesario volver a intentarlo");   
					}     
			} 
			else 
			{ 
				alert ("se ha producido un error"); 
			} 
		} 
		else 
		{ 
			document.getElementById('loading_canvas').style.vi  sibility='visible'; //Mostramos la capa de carga 
	} 
}     
Ahora está funcionando completamente sin cambiar nada. De hecho he probado a cambiar el servidor web de puerto a otro distinto y también funciona.     
				__________________  Por que gastar el dinero cuando hay recursos gratuitos?           |