html
<form class="new_comment" id="new_comment">
<div class="comment-text">
<textarea maxlength="2000" placeholder="写下你的评论…" class="mousetrap" id="reply_content" name="reply_content"></textarea>
<div>
<input type="button" name="commit" id="commit" value="发 表" class="btn btn-info">
<span id="reply">回复帖子</span></div>
</div>
</form>
js
$('#commit').on('click', function () {
$('#new_comment').ajaxSubmit({
type: 'post',
url: "test.php",
success: function (data) {
//data存放需要返回的数据
}
});
});
要引入jquery.js,jquery.form.js