Foros del Web » Programando para Internet » Javascript » Frameworks JS »

-> AHAH (duda)

Estas en el tema de -> AHAH (duda) en el foro de Frameworks JS en Foros del Web. Código PHP: < html >  < head >  < script type = "text/javascript" >   function  ahah ( url , target ) {      document . getElementById ( ...
  #1 (permalink)  
Antiguo 14/04/2008, 15:31
 
Fecha de Ingreso: febrero-2008
Mensajes: 33
Antigüedad: 16 años, 2 meses
Puntos: 1
-> AHAH (duda)

Código PHP:
<html>
 <
head>
 <
script type="text/javascript">

  function 
ahah(url,target) {
    
document.getElementById(target).innerHTML 'loading data...';
    if (
window.XMLHttpRequest) {
        
req = new XMLHttpRequest();
        
req.onreadystatechange = function() {ahahDone(target);};
        
req.open("GET"urltrue);
        
req.send(null);
    } else if (
window.ActiveXObject) {
        
req = new ActiveXObject("Microsoft.XMLHTTP");
        if (
req) {
            
req.onreadystatechange = function() {ahahDone(target);};
            
req.open("GET"urltrue);
            
req.send();
        }
    }
   }

  function 
ahahDone(target) {
   
// only if req is "loaded"
   
if (req.readyState == 4) {
       
// only if "OK"
       
if (req.status == 200 || req.status == 304) {
           
results req.responseText;
           
document.getElementById(target).innerHTML results;
       } else {
           
document.getElementById(target).innerHTML="ahah error:\n" +
               
req.statusText;
       }
   }
  }
  
</script>
  </head>

  <body>

  <a onclick='ahah("http://google.com","url");' href='#'>Google</a> <br><br>

   <div id='url'> </div>

  </body> 
Ese script se supone q al dar click en el link "Google" cargaria google en la div...
Pero me keda loading data... y no cambia...

El script lo obtube de http://microformats.org/wiki/rest/ahah#Send_AHAH_Request
Pero esta en ingles toda la documentacion no entiendo nah!
Si alguien me pueda explicar muchas grax
  #2 (permalink)  
Antiguo 16/04/2008, 06:22
Avatar de MaBoRaK  
Fecha de Ingreso: abril-2003
Ubicación: La Paz - Bolivia
Mensajes: 2.003
Antigüedad: 21 años
Puntos: 35
Re: -> AHAH (duda)

loading.................

No puedes cargar páginas que estén fuera de tu dominio.
Ve esto.
http://radio.javaranch.com/pascarell...962460818.html

connection closed.
__________________

Maborak Technologies
  #3 (permalink)  
Antiguo 18/04/2008, 17:40
Avatar de NUCKLEAR
Moderador radioactivo
 
Fecha de Ingreso: octubre-2005
Ubicación: Cordoba-Argentina
Mensajes: 5.688
Antigüedad: 18 años, 6 meses
Puntos: 890
Re: -> AHAH (duda)

Por que no pruebas alguna libreria para eso http://mjijackson.com/shadowbox/ por ejemplo, ademas de darle un toque mas profesional.
Saludos
__________________
Drupal Argentina
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:04.