Met de volgende code kan je de HTML pagina beveiligen zodat de rechtermuisklik niet meer werkt.
BRON:
www.anouksweb.nl
Code: Selecteer alles
<!-- http://www.anouksweb.nl -->
<!-- Begin code -->
<SCRIPT>
<!--
if (window.Event) // Only Netscape will have the CAPITAL E.
document.captureEvents(Event.MOUSEUP); // catch the mouse up event
function nocontextmenu() // this function only applies to IE4, ignored otherwise.
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e) // This function is used by all others
{
if (window.Event) // again, IE or NAV?
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
document.oncontextmenu = nocontextmenu; // for IE5+
document.onmousedown = norightclick; // for all others
//-->
</SCRIPT>
<!-- End code -->
En nog een script van
www.leejoo.nl
Code: Selecteer alles
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>no-rightclick</title>
<script language="javascript">
function click() {if (event.button==2) {
alert('no copy, neem contact op met de webmaster...thnx....');
// de code \n zorgt voor een nieuwe regel. er hoeft geen spatie na, zoals u ziet. ook niet ervoor
alert('mail naar mail@leejoo.nl');
}}document.onmousedown=click</script>
</head>
<body bgcolor="#000000" text="#00FF00" link="#FF9933" vlink="#00FFFF">
</body>
</html>
Helemaal beveiligen kan je nooit, want met een programma zoals Teleport, kan er een offline kopie worden gemaakt van de website, dus ook van de images die aanwezig zijn.
http://www.tenmax.com/teleport/pro/home.htm
En nog maar eentje.. BRON:
http://www.hypergurl.com/norightclick.html
Code: Selecteer alles
<script language="JavaScript">
// distributed by http://hypergurl.com <!-- var popup="Sorry, right-click
is disabled.\n\nThis Site Copyright ?2000"; function noway(go) { if
(document.all) { if (event.button == 2) { alert(popup); return false; } } if (document.layers)
{ if (go.which == 3) { alert(popup); return false; } } } if (document.layers)
{ document.captureEvents(Event.MOUSEDOWN); } document.onmousedown=noway; // -->
</script>