Common ways to protect text and pictures in your HTML work

Source: Internet
Author: User

Protect your own web page text and pictures:

(1), their own hard to create or collect articles by others "^c^v" stolen, who will not be comfortable in mind. We can add onselectstart= "return false" to our homepage <Body> tag, so that the mouse can not select text;

(2), in the Web page <Body> tags to add oncontextmenu= "Self.event.returnvalue=false" statement, so that the right mouse button can not eject the right button menu, you can not perform the "Picture Save as" command options;

(3), Prohibit the right menu: Add the following code to

<script language=javascript>
function Click ()
{
if (event.button==2)
{alert (' Welcome to visit this site! ')}
}
Document.onmousedown=click
</SCRIPT>

(This method can be easily cracked)

(4), no right-click menu: Pop-up "Add to Favorites" window

<script language=javascript>
<!--
function Click ()
{
if (event.button==2)
{Window.external.addFavorite (This.location,this.document.title)}
}
Document.onmousedown=click
-->
</SCRIPT>

(This method can also be cracked)



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.