Skip to content

Instantly share code, notes, and snippets.

@alfanzain
Created March 11, 2019 11:23
Show Gist options
  • Save alfanzain/68fed749e88a5bd21ad2981b816835eb to your computer and use it in GitHub Desktop.
Save alfanzain/68fed749e88a5bd21ad2981b816835eb to your computer and use it in GitHub Desktop.
$.ajax({
method: "POST",
url: "database.php",
data: {
user: $("input[name=username").val(),
pass: $("input[name=password").val()
},
statusCode: {
500: function() {
response.html('Error : 500');
}
}
}).done(function(data){
if(data == 1)
response.html('Login berhasil !');
else if(data == 2)
response.html('Login gagal.');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment