Created
August 25, 2017 05:28
-
-
Save natmegs/6693c1f12d98d8258b18103acd36151f to your computer and use it in GitHub Desktop.
HTML file used in express app.js example
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
<html> | |
<head> | |
<link href="assets/style.css" type="text/css" rel="stylesheet"/> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" ></script> | |
</head> | |
<body> | |
<h1>Jelly Filled Donut</h1> | |
<form method="POST" action="/person"> | |
First name: <input type="text" id="firstname" name="firstname" /> <br /> | |
Last name: <input type="text" id="lastname" | |
name="lastname" /> <br /> | |
<input type="submit" value="Submit" /> | |
</form> | |
<script> | |
$.ajax({ | |
type: "POST", | |
url: "/personjson", | |
data: JSON.stringify({ firstname: 'Reese', lastname: 'Donut' }), | |
dataType: 'json', | |
contentType: 'application/json' | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment