first commit
This commit is contained in:
10364
webroot/js/jquery.js
vendored
Normal file
10364
webroot/js/jquery.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
36
webroot/js/login.js
Normal file
36
webroot/js/login.js
Normal file
@ -0,0 +1,36 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
$("#error").css('display', 'inline', 'important');
|
||||
$("#error").html("<br>");
|
||||
|
||||
$("#login").click(function(){
|
||||
username=$("#username").val();
|
||||
password=$("#password").val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "login.php",
|
||||
data: "username="+username+"&password="+password+"&login=Login",
|
||||
success: function(response) {
|
||||
|
||||
var answer = JSON.parse(response);
|
||||
|
||||
if(answer.return == 'true') {
|
||||
$("#content").html(answer.string);
|
||||
}
|
||||
else {
|
||||
$("#error").html(answer.string);
|
||||
}
|
||||
},
|
||||
|
||||
beforeSend: function() {
|
||||
$("#error").html("Loading...");
|
||||
},
|
||||
|
||||
error: function() {
|
||||
$("#error").html("Error");
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user