forked from AyatsujiTsukasa/Ant-Planner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.js
28 lines (26 loc) · 780 Bytes
/
login.js
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
$('#loginButton').on("click", function () {
var _this = $(this).parent(),
action = _this.attr("action");
$.get(action, _this.serialize(), function (data) {
if(data === "V"){
window.location = 'userhome.html';
} else {
$('.ajaxMsg').html(data).show();
}
});
});
function onSignIn(googleUser) {
var profile = googleUser.getBasicProfile();
var xhr = new XMLHttpRequest();
xhr.open("POST", "googleSignIn.php");
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function() {
$('.ajaxMsg').html(xhr.responseText).show();
};
xhr.send("username=" + profile.getName() + "&email=" + profile.getEmail());
}
function enter(e){
if (e.keyCode === 13) {
$("#loginButton").click();
}
}