No Right-click Javascript

This is the Javascript for NO RIGHT-CLICK. You can copy & paste it into the section of the document you want to protect. This script will only prevent persons using ver. 4.0+ browsers without knowledge of HTML and Javascript from 'copying images' from your webpages. People using ver. 3.0 browsers will still be able to use the right-click function. It is not intended to be used as a true Security code and is not offered as such.


Test the Javascript! Give the image a right-click.


Place the following Javascript inside the and tags in your HTML document for proper operation:

<!-- Start copying here --!> <script> 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("I dont want you to do that!!!"); return false; } return true; } document.onmousedown=right; if (document.layers) window.captureEvents(Event.MOUSEDOWN); window.onmousedown=right; </script> <!-- End copying here -->

Main HTML Help



Site© 1999-2003 Copyright by dcrum@infionline.net