我正在使用jQuery表单插件API提交表单。它是在后台提交的,但是我如何在一个div (使用id posthere)中显示这个结果(actionpage.php),如下所示。
<form id="myForm" action="actionpage.php" method="post">
Name: <input type="text" name="name" />
<input type="submit" value="Submit Comment" />
</form>
<script>
$('#myForm').ajaxForm();
</script>
<div id="posthere" ></div>发布于 2016-07-28 13:48:01
请尝试以下代码。
$("#myForm").ajaxForm({
success: function(res, status, xhr, form) {
// This will show the direct res over here, you can format it as per your need.
$('#posthere').html(res);
}
});https://stackoverflow.com/questions/38627886
复制相似问题