Jquery带返回值的异步提交表单

来源:互联网 发布:服装行业数据分析 编辑:程序博客网 时间:2024/04/30 23:48

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

0 0