JavaScript Source Code 3000: Page Details: No Right Click
No Right Click
(4.0+ browsers) Ever wanted to prevent users from "borrowing" images from your site through right-clicking them and "save image as..." or right-clicking the page and viewing your page source? This script will (attempt to) disable the right click on your page! As explained, however, this script is not fool-proof !!
[ Try right-clicking the image and then the text link below ]
Text Link
JavaScript Source Code 3000: Page Details: No Right Click
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Apple-s). The script is yours!!!
<!-- TWO STEPS TO INSTALL NO RIGHT CLICK:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript1.1">
<!-- Original: Martin Webb (martin@irt.org) -->
<! >
<! >
<!-- Begin
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;
}
document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>[ Try right-clicking the image and then the text link below ]
<p>
<img src="../img/tjsbutton.gif">
<p>
<a href="http://javascript.internet.com">Text Link</a>
<!-- Script Size: 1.57 KB -->
Wyszukiwarka
Podobne podstrony:
no right clickright click menuTompkins Right Hemisphere Brain Damage2002 09 Creating Virtual Worlds with Pov Ray and the Right Front EndNo Words AloneEula NO166 T S 1998 petrol NOno art 1No last songNo Place Like HomeEverlast Speak No EvilAccept Wrong Is Rightmargin rightwięcej podobnych podstron