$(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,让上一步做最终的处理
}
}); });