在html5中,<button>中屬性type默認爲submit,因此,<button>會提交兩次。html
將<button>改成<input type='button'/>html5
或spa
<button type='button'/>htm