-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
37 lines (33 loc) · 897 Bytes
/
index.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
29
30
31
32
33
34
35
36
37
/**
* Created by Guy Peer on 21/08/2015.
*/
$(document).ready(function() {
if (Parse.User.current()) {
location = "MainPage.html";
}
/*
* Login with user name and password
*/
$("#login").click(function(event){
var name = $("#username").val();
var pass = $("#password").val();
Parse.User.logIn(name, pass, {
success: function(user){
alert("welcome" +" " +name);
location = "MainPage.html";
},
error: function(user, error){
alert('Incorrect user name or password');
$("#username").val('');
$("#password").val('');
$("#username").focus();
}
});
});
/*
* Go to the sign up page
*/
$("#signUp").click(function(event){
location = "SignUp.html";
});
});