-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.js
More file actions
21 lines (21 loc) · 706 Bytes
/
signup.js
File metadata and controls
21 lines (21 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$(function(){
$('#signupBtn').click(function(){
var username = $('#usr').val();
var password = $('#pwd').val();
var url = "https://2xcxiwvvy8.execute-api.us-east-2.amazonaws.com/prod/addUser";
url += "?username=" + username;
url += "&password=" + password;
url += "&isAdmin=false";
if(username && password) {
$.post(url, function(data) {
if(data){
if(data.insertId != -1){
window.location = "home.html";
} else{
$('#alertWindow').removeClass('hidden');
}
}
});
}
});
});