completely prohibit viewing the Web page source code
block Right-click, copy, select the full code:
<script > Document.oncontextmenu =new Function ("Return false" =new Function ("return false" </script>
Select the text or right-click to see
or
<body oncontextmenu= "return false" onselectstart= "return false" >
Select Text or right-click to see
How to view the source code
----to prevent visitors from viewing the source code of the Web page, first look at how to view the source code (IE 5.0 for example). One is the right-click menu mode; Second, the Window menu bar viewing mode, that is, select "View" * "source file" mode. To completely prohibit visitors from viewing the source code of the Web page, you must block these 2 ways to view the source code.
One: Screen Right-click menu View
----Now, many Web pages use the following code to screen the right-click menu:
< Script language=javascript>
Function Click () {
if (event.button==2) {alert
(' Masking right-click menu ');
}}
Document.onmousedown=click;
</script>
Other methods
<script language=javascript>function Click () {if (event.button==2) {alert (' Don't you peek! ‘);}} Document.onmousedown=click</script>
Prevent others from viewing your page's source code