Advertisement
gundambison

js save

May 20th, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     function save()
  2.     {
  3.         console.log(save);
  4.         console.log($('#form').serialize());
  5.         var url;
  6.         // ajax adding data to database
  7.         $.ajax({
  8.             url: "<?php echo site_url('Data/sendmails') ?>",
  9.             type: "POST",
  10.             data: $('#form').serialize(),
  11.             dataType: "JSON",
  12.             success: function (d) {
  13.                 console.log('succ');
  14.                 console.log(d);
  15.             },
  16.             error: function (xhr, stat, err) {
  17.                 console.log('error');
  18.                 console.log(xhr, stat, err);
  19.             }
  20.         });
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement