html5 button提交两次

点击提交按钮,页面会提交两次。

发生缘由:

在html5中,<button>中属性type默认为submit,因此,<button>会提交两次。html

解决方案:

将<button>改成<input type='button'/>html5

spa

<button type='button'/>htm

相关文章
相关标签/搜索