Six-way to keep your Web page closed

Source: Internet
Author: User
Tags empty return
Web page

One, no right-click menu: oncontextmenu= "return False"

Second, prohibit dragging: ondragstart= "return False"

Third, prohibit selection: Onselectstart = "return false" onselect= "Document.selection.empty ()"

Four, prohibit the copy: oncopy= "Document.selection.empty ()" onbeforecopy= "return False"

Five, forbidden to save: <noscript><iframe src=*></iframe></noscript>

Six, do not view the source code: this does not prepare the program, because now also exist most of the programs are stupid, are through the ban right-click menu, and control does not display the menu to control. Some video online playback site by the video file name with server-side script stored in the customer's cookies, and then get in JS, to play, this method seems to be good. If the source code is prohibited from being seen, it should be done, even if the user downloads the Web page to the local area. Can be controlled by server-side scripting, client script, and cookie binding. I didn't write the code because I didn't think it was necessary to protect it. So there's not much value in this procedure. For example, some information sites actually prohibit copying. Really do not know how to think, you think so people can not get information to the local, people could download, look at the source code, the most absolute and grasp the map. So I think since you show it to others, you should make it easy for people to collect the information.



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.