Ver Mensaje Individual
  #5 (permalink)  
Antiguo 16/09/2012, 11:11
gebremswar
 
Fecha de Ingreso: enero-2012
Ubicación: Santiago de Surco, Lima - Perú
Mensajes: 266
Antigüedad: 12 años, 3 meses
Puntos: 57
Respuesta: problemas con los eventos jquery al usar ajax

Prueba con esto:

Código Javascript:
Ver original
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Multi Form Edit</title>
  6. <script src="http://code.jquery.com/jquery-1.8.1.min.js"></script>
  7. <script>
  8. var newImg = '<div><img class="crr" src="http://groups.viadeo.com/template/images/global/dialogs/close-button.png" title="Cerrar"></div>';
  9. $(document).on('ready',function() {
  10.     $('#add').on({
  11.         click:function(){
  12.             $('.qbox').append(newImg);
  13.         }
  14.     });
  15.     $('div.qbox').on("click", 'img.crr', function(){
  16.         $("div.qbox").hide();
  17.     });
  18. });
  19. </script>
  20. </head>
  21. <body>
  22. <input type="button" id="add" value="add new image">
  23. <div class="qbox">
  24. </div>
  25. </body>
  26. </html>

Coméntanos.