$(document).ready(function(){ajax
//取消異步的代碼異步
$.ajaxSetup({async
async: false spa
});it
//到按下 enter 鍵的處理邏輯io
$(document).keydown(function(){event
var e = event || window.event || arguments.callee.caller.arguments[0];function
if(e && e.keyCode==13){call
sendSubmit(); //這裏應該有返回的,但並無等待而是繼續執行下去co
return false; // 由於上一步繼續執行下去會報錯,因此這裏要return false,讓上一步做最終的處理
}
}); });