Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#btn-reg').click(function() {
- alert('clicked')
- console.log($('#regName').val())
- console.log($('#regEmail').val())
- console.log($('#regPass').val())
- $.ajax({
- url: "/register",
- type: "POST",
- dataType: "application/json",
- data: {
- username: $('#regName').val(),
- email: $('#regEmail').val(),
- password: $('#regPass').val()
- },
- contentType: "application/json",
- cache: false,
- timeout: 5000,
- complete: function() {
- //called when complete
- console.log('process complete');
- },
- success: function(data) {
- console.log(data);
- console.log('process sucess');
- },
- error: function() {
- console.log('process error');
- },
- });
- });
Add Comment
Please, Sign In to add comment