<script type="text/javascript">
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) { getTableListData();//具體處理函數 return false; } return true; } </script>
若是隻是針對某個DIV層應用回車查詢的話,能夠將: document.onkeydown=keyDownSearch; 改爲: document.getElementById('層ID').onkeydown=keyDownSearch;