在给button写disabled:false时,要指定到某个button,不要只写$('button').attr('disabled',false),
这样会导致如果页面中有form提交的表单,同时button没有写type的话,就会默认为submit,自动提交了
原因:$('button').attr('disabled',false),,所以任何button点击完都不是disabled:true
注:在form提交时,如果按钮只是按钮的作用,一定要写type="button"
在给button写disabled:false时,要指定到某个button,不要只写$('button').attr('disabled',false),
这样会导致如果页面中有form提交的表单,同时button没有写type的话,就会默认为submit,自动提交了
原因:$('button').attr('disabled',false),,所以任何button点击完都不是disabled:true
注:在form提交时,如果按钮只是按钮的作用,一定要写type="button"