Guest User

Untitled

a guest
Dec 17th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. $('#btn-reg').click(function() {
  2. alert('clicked')
  3. console.log($('#regName').val())
  4. console.log($('#regEmail').val())
  5. console.log($('#regPass').val())
  6. $.ajax({
  7. url: "/register",
  8. type: "POST",
  9. dataType: "application/json",
  10. data: {
  11. username: $('#regName').val(),
  12. email: $('#regEmail').val(),
  13. password: $('#regPass').val()
  14. },
  15. contentType: "application/json",
  16. cache: false,
  17. timeout: 5000,
  18. complete: function() {
  19. //called when complete
  20. console.log('process complete');
  21. },
  22.  
  23. success: function(data) {
  24. console.log(data);
  25. console.log('process sucess');
  26. },
  27.  
  28. error: function() {
  29. console.log('process error');
  30. },
  31. });
  32. });
Add Comment
Please, Sign In to add comment