2019-09-13 13:57:33 +00:00
|
|
|
$(document).ready(function() {
|
2019-09-20 14:46:13 +00:00
|
|
|
$('#loginbtn').click(function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
console.log("clicked login button");
|
|
|
|
var username = $("#userfield")[0].value;
|
|
|
|
var password = $("#passfield")[0].value;
|
|
|
|
|
2019-09-27 08:58:13 +00:00
|
|
|
$.post('/senddata/loginget','username='+username+'&password='+password,function(data){
|
2019-09-20 14:46:13 +00:00
|
|
|
|
|
|
|
console.log(data);
|
|
|
|
if (data.accept == true) {
|
|
|
|
console.log("successfully logged in!");
|
2019-09-27 08:58:13 +00:00
|
|
|
document.cookie = "username="+username;
|
2019-09-20 14:46:13 +00:00
|
|
|
window.location = 'settings.html';
|
|
|
|
}
|
|
|
|
},'json');
|
|
|
|
});
|
2019-09-13 13:57:33 +00:00
|
|
|
});
|