top left
The HTML Source Logo


 html
Top Right
    
 Getting StartedHow Do I...TroubleShootingPromotionContact Us
 html
HTML
SEARCH THE SITE
advanced search



CATEGORIES
Home
Getting Started
HTML Cheat Sheet
Webmaster Tools
HTML Help Forum
Color Codes
Link to us









































bottom
HTML HTML HTML HTML
No Right Clicking



What This Is

Have you put a lot of time into building your web page? You would hate to be browsing the internet one day and find a page that looks exactly like yours, your graphics, your scripts, all the stuff that took you so long to make. This happens to webmasters all the time, and where here to help prevent that.

The following is a No-Right Click script, which means it disables right clicking on the page so it prevents users from right clicking and saving your images, or right clicking and viewing the source etc...

This does prevent some people from stealing your content, but it is in no way guaranteed. If a good enough thief really wants something from your page, he or she can get it. The No-Right Click script just makes things tougher for them, and for the average web user who doesn't know any other way to save an image besides right clicking impossible to steal.

Want an example, try right clicking on this page.


Directions

Adding this to your web page is very simple, it just requires a little JavaScript:

First, Copy and Paste the following script in between your <HEAD> </HEAD> tag's.

Click HERE to select the script, and press Control - C on your keyboard (or APPLE - C if your using a Mac) to copy the script.


Editing This Script

The only part of this script you may want to edit is the text in the box that comes up when you right click. As of now when you right click a box comes up saying (Sorry, you do not have permission to right click.) To replace this with something else, just replace that text in the above code with what you want it to say

function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("Sorry, you do not have permission to right click.");
return false;
}
return true;
}




Company   |   Careers   |   Partners   |   Advertising   |   Help
Privacy Policy   |   Trademark Notices   |   User Agreement
© 2001 TheHTMlSource.com, INC. All Rights Reserved.



Site hosted by Angelfire.com: Build your free website today!