Created
July 4, 2012 15:57
-
-
Save darkfrog26/3048034 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Ajax POST Example</title> | |
<script src="/js/jquery-1.7.2.js"></script> | |
</head> | |
<body> | |
<form id="postForm" action="/"> | |
<label>Name</label> | |
<input name="name" type="text"/> | |
<label>Phone</label> | |
<input name="phone" type="text"/> | |
<input type="submit"/> | |
</form> | |
<div id="result"></div> | |
<script> | |
$("#postForm").submit(function(event) { | |
event.preventDefault(); | |
$.post("/service/postexample", $("#postForm").serialize(), function(data) { | |
alert('Testing: ' + data.message); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment