Valuable practical code

Source: Internet
Author: User
Code: blocked class: 1. disable right-click bodyoncontextmenureturn (false) 2. disable bodyonselectstartreturnfalse3. disable bodyonpastereturnfalse4. disable direct access to [must be in the framework] scriptif (topself) top. location. hrefpa code:


Blocking prohibited class:

1. right-click disabled


2. do not select


3. disable pasting.


4. prohibit direct access [only within the framework]
Script
If (top = self) top. location. href = "page.htm ";
Script

5. disable frame reference
Script
If (top! = Self) top. location. href = "page.htm ";
Script

6. disable function keys Shift, Alt, Ctrl
Script function key (){
If (event. shiftKey) alert ("Shift is not allowed! ");} Document. onkeydown = key; script





Data acquisition

1. get resolution
Script document. write ("Width" + screen. Width + "Height" + screen. Height) script


2. get the address bar
Script document. write (self. location) script

3. get the address bar? Post parameter
SCRIPT var add = top. location;
Add = add. toString ();
Document. write (add. substring (add. indexOf ("? ") + 1, add. length ));
SCRIPT





Common special effects

1. home page remote control
File 1. (t1.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.