Typical javascript effect code

Source: Internet
Author: User
Code
The code for saving prohibited webpages is:
<Noscript> <iframe src = "*. htm"> </iframe> </noscript>

Local ip address <% = request. servervariables ("remote_addr") %>
Server name <% = Request. ServerVariables ("SERVER_NAME") %>
Server IP <% = Request. ServerVariables ("LOCAL_ADDR") %>
Server port <% = Request. ServerVariables ("SERVER_PORT") %>

Code ASP that is prohibited from being cached on the webpage
<%
Response. Expires = 0
Response. ExpiresAbsolute = Now ()-1
Response. CacheControl = "no-cache"
%>

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

6. Your icons are displayed in favorites.
<Link rel = "Bookmark" href = "favicon. ico">

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.

8. Always carry the framework

<Script language = "javascript"> <! --
If (window = top) top. location. href = "frames.htm"; // --> </script> 9. Prevent frame

<Script language = javascript> <! --
If (top. location! = Self. location) top. location = self. location;
// --> </SCRIPT>

<Input style = "ime-mode: disabled">

9. Check the source file

<Input type = button value = view webpage source code
Onclick = "window. location = 'view-source: '+ 'HTTP: // www.e3i5.com/test.htm';">

10. Block function keys Shift, Alt, Ctrl
<Script>
Function look (){
If (event. shiftKey)
Alert ("do not press Shift! "); // You can change it to ALT CTRL
}
Document. onkeydown = look;
</Script>

11. The cursor stops at the end of the text box.
<Script language = "java script">
Function cc ()
{
Var e = event. srcElement;
Var r = e. createTextRange ();
R. moveStart ("character", e. value. length );
R. collapse (true );
R. select ();
}
</Script>
<Input type = text name = text1 value = "123" onfocus = "cc ()">

 

 

Reprinted from: http://www.cnblogs.com/ZHF/articles/1407045.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.