Created
January 30, 2021 22:54
-
-
Save Downes/8a91548937e6cf4c6b98d3426f113a3e to your computer and use it in GitHub Desktop.
Remote Comment Form
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 lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Remote Comment Example</title> | |
<link href="http://www.mooc.ca/cgi-bin/api.cgi" rel="webmention" /> | |
</head> | |
<body> | |
<h1>Blog Post</h1> | |
<p>Here is the text of my blog post. Don't you juyst want to comment?</p> | |
<h2>Comment:</h2> | |
<form action='' name='myform' id="myform" method='POST'> | |
<input type='text' name='cars' placeholder="Your website" id="cars"> (URL for content submission on my own website)<br> | |
<input type='hidden' name='action' value="rcomment"> | |
<input type='text' name='title' value='Blog Post'> (Auto-populated with the title of the post I'm commenting on)<br> | |
Hidden fields: 'author' and 'feed', auto-populated with the information about the post I'm cpommenting on (optional, but better)<br> | |
<input type='hidden' name='author' value='Stephen Downes'> | |
<input type='hidden' name='feed' value='MOOC.ca'> | |
<textarea rows=20 cols=100 name="description" placeholder="Enter comment here"></textarea><br> | |
<button action='submit'>Submit Comment</button> | |
</form> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> | |
<script> | |
// Shorthand for $(document).ready(); | |
$(function() { | |
$('#myform').submit(function(){ | |
var car = $('#cars').val(); | |
$(this).attr('action', car); | |
alert($(this).attr('action')); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment