Created
September 7, 2010 14:35
-
-
Save pkarl/568441 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 class='some-inline-input'> | |
<p>Please enter some text in this box, then submit it!</p> | |
<textarea id="posted_text"></textarea> | |
<a class="post-text" href="/post/to/this/url">submit text with a POST request</a> | |
</div> | |
<script> | |
$('.post-text').click(function() { | |
var target = $(this) | |
$.post({ | |
url: target.attr('href'), | |
data: $('#posted_text'), | |
success: function(data) { | |
alert(data); | |
} | |
}); | |
return false; | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment