Created
October 10, 2014 03:06
-
-
Save xShirase/bc6e6543d00ae7576a72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type = "text/javascript"> | |
$(document).ready(function() { | |
$('form').on('submit', function(e){ | |
e.preventDefault() | |
$.ajax({ | |
type: 'POST', | |
url: '/login', | |
data: { | |
username: $('#us').val(), | |
password: $('#pass').val() | |
}, | |
success: function(result) { | |
if (!result) { | |
//$('form input[name="username"]').css("background-color", "red"); | |
console.log(result); | |
} | |
}, | |
error: function(xhr, ajaxOptions, thrownError) { | |
console.log(xhr.status); | |
console.log(thrownError); | |
} | |
}); | |
}); | |
}); | |
< /script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment