Guest User

Untitled

a guest
Apr 24th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <script type="text/javascript" charset="utf-8">
  2. jQuery(document).ready(function($) {
  3. $('a[rel*=facebox]').facebox();
  4. $('.new_project form').ajaxForm({
  5. target: '.new_project #form_response',
  6. success: function() { }
  7. });
  8. });
  9. </script>
  10.  
  11. $().facebox() creates the new DOM element with the form. I need $().ajaxForm() to recognize it using the jQuery selector .new_project form. How would I use $().live() to do what I need?
  12.  
  13. Like this?
  14.  
  15. <script type="text/javascript" charset="utf-8">
  16. jQuery(document).ready(function($) {
  17. $('a[rel*=facebox]').facebox();
  18. $('a[rel*=facebox]').live('click', function() {
  19. $('.new_project form').ajaxForm({
  20. target: '.new_project #form_response',
  21. success: function() { }
  22. });
  23. });
  24. });
  25. </script>
Add Comment
Please, Sign In to add comment