<script type="text/javascript">
$(function () {
//(document).ready
var $username = $('#username');
var $password = $('#password');
$("#btnSignIn").click(function(){
var user_credentials = {
username: $username.val(),
password: $password.val()
};
$.ajax({
type: 'POST',
url: '/users/login',
data: user_credentials,
success: function(data) {
//alert alert-success
$("#response").html("<div class='alert alert-success'><p><strong>" + data + "</strong> You are using an awesome template!</p>-</div>");
},
error: function(data) {
//alert alert-danger
$("#response").html("<div class='alert alert-danger'><p><strong>"+ data + "</strong> You are using an awesome template!</p>-</div>");
}
});
});
});
</script>