button有时默认的事件是submit,会导致页面重新刷新一次,有些想要的数据会一闪而过
解决方法
1.input type=“button”
2.$('btn').click(function(e){
e.preventDefult();
});
button有时默认的事件是submit,会导致页面重新刷新一次,有些想要的数据会一闪而过
解决方法
1.input type=“button”
2.$('btn').click(function(e){
e.preventDefult();
});