問題:為什么點擊 button 會刷新頁面 ?
原因:你代碼的寫法可能如下圖,把 <button> 按鈕 寫在 <form> </form> 標簽里邊啦。

<button> 放在 form 里邊, 除了 IE 中 默認 type = "button", 其他瀏覽器默認 type = "submit" 具有表單提交功能。
解決方案:
一 :修改 按鈕的 書寫方式 ,改為 <input type="button"> ;
二 :阻止默認事件, 在button的點擊事件中加入“e.preventDefult()”
$('btn').click(function(e){
e.preventDefult();
});
