Ver Mensaje Individual
  #8 (permalink)  
Antiguo 04/10/2006, 12:06
Avatar de ikhuerta
ikhuerta
 
Fecha de Ingreso: octubre-2006
Mensajes: 104
Antigüedad: 17 años, 7 meses
Puntos: 0
librerias hay a patadas quizá la mas interesante es prototype pero es muy pesada...

Si lo unico que quieres es recargar un div por id te bastará con una función como esta (en realidad 2 pero la primera solo crea el objeto xmlhttprequest):

Código:
function cXHR(){ var XHR=false; if (window.ActiveXObject){XHR=new ActiveXObject("Microsoft.XMLHTTP");}else if(window.XMLHttpRequest){XHR=new XMLHttpRequest();}if(XHR)return XHR;else alert("Error: AJAX no funciona en su navegador actualicelo.");}

function ajax(id_div,URL_a_cargar) {
	XHR=cXHR(); XHR.open( "GET", URL_a_cargar , true );
	XHR.onreadystatechange=function(){
                   if (XHR.readyState==4)	
                      if (XHR.status==200) document.getElmentById(id_div).innerHTML=XHR.responseText;
                      else if(XHR.status==404) alert("Error: La página llamada con AJAX no existe");
                           else alert("Error "+XHR.status+": "+XHR.statusText);}
        XHR.send(null);}
asi con "ajax(id_de_tu_div, URL_a_Carga);" realizarás el cambio.

Con esto te bastará... (puede que le falle algún punto y coma, revisalo :P)