<! -- Right-click prohibited code -->
<NoScript> <IFRAME src = *. html> </iframe> </NoScript>
<Script language = JavaScript>
<! --
If (window. Event)
Document. captureevents (event. mouseup );
Function nocontextmenu (){
Event. cancelbubble = true
Event. returnvalue = false;
Return false;
}
Function norightclick (e ){
If (window. Event ){
If (E. Which = 2 | E. Which = 3)
Return false;
}
Else
If (event. Button = 2 | event. Button = 3 ){
Event. cancelbubble = true
Event. returnvalue = false;
Return false;
}
}
Document. oncontextmenu = nocontextmenu; // For ie5 +
Document. onmousedown = norightclick; // for all others
// -->
</SCRIPT>
1. the right-click dialog box is completely blocked, and no shortcut menu is available.
<Body oncontextmenu = "window. event. returnvalue = false">
It can also be used in the table framework of a webpage.
<Table border oncontextmenu = return (false)> <TD> NO </table>
2. Cancel selection and prevent Replication
<Body onselectstart = "Return false">
3. Do not paste
<Body onpaste = "Return false">
4. Prevent Replication
<Body oncopy = "Return false;" oncut = "Return false;">
5. Replace the IE icon in front of the address bar
<LINK rel = "shortcut icon" href = "favicon. ICO">
Note: The favicon. ICO file is created. You can create an image in FW to create a small icon on your own site. Then change the file attribute to * in ACD see *. ICO, and then perform *. the ICO file is uploaded to your server directory and can be implemented using the above Code. When someone else logs on to your site, your custom icon is used in the address bar. Very pp.
6. You can display your icons in the favorites folder.
Add the following statement to the <LINK rel = "shortcuticon" href = "http ://... /Icon. ICO "> "〉
You can. The icon. ICO is a 16x16 icon file,
The color must not exceed 16.
Note: The production method is the same as above. The display method is different. This is the personal icon displayed when someone else adds Your webpage address to favorites. Pp.
7. Disable the Input Method
<Input style = "ime-mode: Disabled">
Note: This code is used when submitting a table. That is, other input methods cannot be used when data is input.
Typical webpage code (2)
8. Always carry the framework
<Script language = "JavaScript"> <! --
If (window = Top) top. Location. href = "frames.htm"; // --> </SCRIPT>
Note: frames.htm Is Your webpage. This is also a method to protect the webpage.
9. Prevent Frame
<Script language = JavaScript> <! --
If (top. location! = Self. Location) top. Location = self. location;
// --> </SCRIPT>
10. The webpage cannot be saved
<NoScript> <IFRAME src = *. html> </iframe> </NoScript>
Note: <noscirpt> is widely used, one of which can invalidate JS ads.
11. Check the source file
<Input type = button value = view webpage source code
Onclick = "window. Location = 'view-Source: '+ 'HTTP: // www.e3i5.com/test.htm';">
12. Cookie script records are of great use.
Function get_cookie (name ){
VaR search = Name + "="
VaR returnvalue = "";
If (events. Cookie. length> 0 ){
Offset = documents. Cookie. indexof (Search)
If (offset! =-1) {// If Cookie exists
Offset + = search. Length
// SET index of beginning of Value
End = documents. Cookie. indexof (";", offset );
// SET index of end of cookie value
If (END =-1)
End = documents. Cookie. length;
Returnvalue = Unescape (events. Cookie. substring (offset, end ))
}
}
Return returnvalue;
}
Function loadpopup (){
If (get_cookie ('popped') = ''){
Openpopup ()
Documents. Cookie = "popped = yes"
}
}
Note: The above is the JS Code. Please add the start and end characters on your own.