回车键搜索兼容性问题

document.onkeydown = keyDownSearch;

function keyDownSearch(e) { // 兼容FF和IE和Opera

var theEvent = e || window.event;

var code = theEvent.keyCode || theEvent.which || theEvent.charCode;

if (code == 13) { return false; } return true; }

posted on 2017-03-27 20:35  酱果子  阅读(271)  评论(0)    收藏  举报