Ver Mensaje Individual
  #20 (permalink)  
Antiguo 27/04/2007, 09:28
Daca
 
Fecha de Ingreso: julio-2003
Mensajes: 141
Antigüedad: 20 años, 10 meses
Puntos: 5
Re: sobre ajax, porque no lo hace ?

Hola!
Habeis probado con la libreria de Prototype?, resuelve muy bien los problemas que comentais de Request que tienen JavaScripts ...

Os adjunto un ejemplo ...
Código HTML:
 <script type="text/javascript" src="http://url/to/prototype.js"></script>
    <script type="text/javascript">
      window.onload = inicio;
      function inicio() {
        Event.observe('div_uno','click',peticion,false);
      }
      function peticion() {
        var opciones = { evalScripts: true };
        var url = 'hola.html';
        new Ajax.Updater("resp",url,opciones);
      }
    </script>

<body>

<div id="div_uno"  style="border: 1px solid black;">
Haz click en este div y recibiras un alert via Ajax;
</div>
<br />
<div id="resp" style="font-weight: bold; border: 1px solid blue;">
Esperando ...
</div>

</body> 
Y el fichero hola.html contiene:
Código HTML:
Peticion Ajax correcta
<script type="text/javascript">
alert('hola');
</script> 
Espero sirva ...
Saludos!!