Blogger Information
Blog 175
fans 1
comment 0
visits 384650
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
JS监听整个页面的回车事件
dxp2tq的博客
Original
911 people have browsed it

<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;    

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post