Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     $('.register').on('submit', function(e) {
  2.       console.log('making user...');
  3.       e.preventDefault();
  4.       $.ajax({
  5.         url: '/cs/new_user.php',
  6.         type: 'POST',
  7.         contentType: 'application/json',
  8.         dataType: 'json',
  9.         data: {
  10.           user: $('.user').val(),
  11.           pass: $('.pass').val(),
  12.           email: $('.email').val()
  13.         },
  14.         success: function(msg) {
  15.           console.log(msg.toString());
  16.           if (!msg.sucess)
  17.             $('.msg').text(msg.msg);
  18.         },
  19.         error: function(xhr, status, err) {
  20.           console.log(xhr.responseText);
  21.         }
  22.       });
  23.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement