表单不刷新提交
电脑版发表于:2020/3/9 14:46
way1:给form表单加onsubmit事件,值为return false
<form action="" method="post" onsubmit="return false"> <button type="submit" class="btn btn-primary">提交</button> </form>
way2:在FORM表单后添加一个iframe
<form action='' method='post' name='iframeForm' target="iframeForm"> <button type="submit" class="btn btn-primary">提交</button> </form> <iframe id="iframeForm" name="iframeForm" style="display:none;"></iframe>