因爲button標籤按鈕會提交表單。
解決方法如下:
1、將<button></button>改爲<input type="button"> 或者直接在<button>中添加屬性 type="button".
2、在button的點擊事件中加入“e.preventDefult()”
$('btn').click(function(e){
e.preventDefult();
});
點擊button刷新的幾種常用代碼:
1、<input type=button value=刷新 οnclick="history.go(0)">
2、<input type=button value=刷新 οnclick="location.reload()">
3、<input type=button value=刷新 οnclick="location=location">
4、<input type=button value=刷新 οnclick="location.assign(location)">
5、<input type=button value=刷新 οnclick="document.execcommand(refresh)">
6、<input type=button value=刷新 οnclick="window.navigate(location)">
7、<input type=button value=刷新 οnclick="location.replace(location)">
8、<input type=button value=刷新 οnclick="window.open(自身的文件,_self)">
9、<input type=button value=刷新 οnclick=document.all.webbrowser.execwb(22,1)>