29 lines
802 B
Handlebars
29 lines
802 B
Handlebars
<html>
|
|
<head>
|
|
<title>Session Management in NodeJS using Express4.2</title>
|
|
<script src="assets/jquery-3.3.1.min.js"></script>
|
|
<script>
|
|
$(document).ready(function(){
|
|
var name,pass;
|
|
$("#submit").click(function(){
|
|
name=$("#name").val();
|
|
pass=$("#password").val();
|
|
/*
|
|
* Perform some validation here.
|
|
*/
|
|
$.post(window.location.href, {name:name,pass:pass}, function(data){
|
|
if(data==='success')
|
|
{
|
|
window.location.href="/";
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<input type="text" size="40" placeholder="Type your name" id="name"><br />
|
|
<input type="password" size="40" placeholder="Type your password" id="password"><br />
|
|
<input type="button" value="Submit" id="submit">
|
|
</body>
|
|
</html>
|