Ver Mensaje Individual
  #6 (permalink)  
Antiguo 24/10/2006, 13:31
Avatar de ikhuerta
ikhuerta
 
Fecha de Ingreso: octubre-2006
Mensajes: 104
Antigüedad: 17 años, 7 meses
Puntos: 0
Buenas paranoid como te he dicho aqui tienes el codigo arreglado:
(cuidado con los saltos de linea que se hayan podido ocurrir por no caber...)

Código:
<script type="text/javascript">
req=new Array;
function cXHR(){ var oXHR=false; if (window.ActiveXObject){oXHR=new ActiveXObject("Microsoft.XMLHTTP");}else if(window.XMLHttpRequest){oXHR=new XMLHttpRequest();}if(oXHR)return oXHR;else alert("Error: AJAX no funciona en su navegador actualicelo.");}
function $$(id){ if (document.getElementById(id)) return document.getElementById(id); else  alert("Id Incorrecta: " + id + ". La id pasada a clientSideInclude() no era valida. Necesitas crear un div o Span con esa id en tu pagina web" );}

function clientSideInclude(id, url) {
n=req.length;
req[n]=cXHR();
  
req[n].open("GET", url, true);
req[n].onreadystatechange=function(){if (req[n].readyState==4){	
						if (XHR[n].status==200){ $$(id).innerHTML=req[n].responseText;  }
						else if(XHR[n].status==404){alert("Error: La url llamada con AJAX no existe");}
						else {alert("Error "+XHR[n].status+": "+XHR[n].statusText);}}}
req[n].send();
}
</script>
La llamada luego ser haría simplemente con al funcion clientSideInclude(id, url)

Espero que ahora si que te salga.

Iñaki.