一段js代码屏蔽右键 F12 审核元素查看源代码

本段js需要引入jquery,请自行引入吧!

<script type="text/javascript">
    $(document).ready(function(){ //jQuery 屏蔽右键 
    $(document).bind("contextmenu",function(e){return false;});});
    $(document).ready(function() { //jQuery 屏蔽F5
    $(document).bind("keydown",function(e){e=window.event||e; if(e.keyCode==116){e.keyCode = 0;return  false;} }); }); 
    $(document).ready(function() { //jQuery 屏蔽F7 
    $(document).bind("keydown",function(e){e=window.event||e; if(e.keyCode==118){e.keyCode = 0;return  false;} }); });
    $(document).ready(function() { //jQuery 屏蔽F11 
    $(document).bind("keydown",function(e){e=window.event||e; if(e.keyCode==122){e.keyCode = 0;return  false;} }); });
    $(document).ready(function() { //jQuery 屏蔽F12 
    $(document).bind("keydown",function(e){e=window.event||e; if(e.keyCode==123){e.keyCode = 0;return  false;} }); });
</script>
Last modification:November 8th, 2019 at 12:34 am
如果觉得我的文章对你有用,请随意赞赏

Leave a Comment