Ver Mensaje Individual
  #2 (permalink)  
Antiguo 21/07/2011, 09:31
Avatar de Ronin46
Ronin46
 
Fecha de Ingreso: junio-2009
Mensajes: 398
Antigüedad: 14 años, 10 meses
Puntos: 8
Respuesta: Jquery: duda de principiante

Me respondo a mi mismo :)

a.php
Código PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<
html>
<
head>
    <
script src="jquery-1.6.2.min.js" type="text/javascript" ></script>
    <script type="text/javascript">
        $(document).ready(function(){
           $("#link1").click(function(evento){
              evento.preventDefault();
              $("#Aqui").load("b.php");
           });
        });
        
        $(document).ready(function(){
           $("#link2").live('click', function(evento){
              evento.preventDefault();
              alert("Link 2");
           });
        });
    </script>
</head>
<body>
    <a id="link1" href="#">Link 1</a>
    <div id="Aqui"></div>
</body>
</html> 
b.php
Código PHP:
<a id="link2" href="#">Link 2</a
El quiz de la cuestión está en el evento .live()
__________________
http://www.controldegastos.com, acepto sugerencias para el sitio.
Repetir conmingo: "tengo que dedicar más tiempo a gozar de placer"