-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.js
More file actions
28 lines (26 loc) · 690 Bytes
/
signup.js
File metadata and controls
28 lines (26 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$(document).ready(function() {
$("#signupForm").submit(function(e) {
e.preventDefault();
var email = $("#email").val();
var name = $("#name").val();
var password = $("#password").val();
var profile = $("#profile").val();
$.ajax({
method: "POST",
url: "http://127.0.0.1:5000/sign-up",
data: JSON.stringify({
"email" : email,
"name" : name,
"password" : password,
"profile" : profile
}),
contentType: 'application/json'
})
.done(function(msg) {
console.log(msg)
if (msg.email === email) {
window.location.href = './login.html';
}
});
});
});