Created
March 16, 2013 05:52
-
-
Save mojaray2k/5175178 to your computer and use it in GitHub Desktop.
This is a jQuery Ajax Template 3 - This example uses jsonp
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
$('#login form').submit(login); | |
function login(e){ | |
e.preventDefault(); | |
$('#login h4').slideUp(); | |
//var email = $('#login #email').val(); | |
//var password = $('#login #password').val(); | |
var form = $(this).serialize(); | |
$.ajax('/login', { | |
//data: { 'email': email, 'password': password } | |
data: form, | |
dtatType: 'script', | |
type: 'post' | |
}); | |
} |
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
<div id="login"> | |
<form> | |
<h4>Please login to book flight:</h4> | |
<p> | |
<label>Email:</label> | |
<input type='email' name'email' id="email" /> | |
</p> | |
<p> | |
<label>Password:</label> | |
<input type='password' name'password' id="password" /> | |
</p> | |
<p> | |
<input type='submit' value="Login" /> | |
</p> | |
</form> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment