Advertisement
lamiastella

main.js submit (jQuery)

Jun 10th, 2020
2,028
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.55 KB | None | 0 0
  1. /* submit button */
  2.  
  3. $(function () {
  4.     $('form').on('submit'){
  5.         $.ajax(
  6.                         {
  7.                             url:'/submitData',
  8.                             data: $('form').serialize(),
  9.                             type: 'POST',
  10.                             success: function (response) {
  11.                             console.log(response);
  12.                         },
  13.                         error: function (error){
  14.                             console.log(error)
  15.                         }
  16.                     });
  17.     });
  18.  
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement