ID:165867
 
what html would you use to disallow rightclicking?

p.s.please make answers dm-compatible.Thanks in advance
it wouldnt be html it would be javascript

============================================================
Script: Basic No-Right-Click Script
Functions: Blocks right-click on mouse and shows alert box
Browsers: NS & IE 4.0 & later; degrades gracefully
Author: etLux
============================================================

Put the following script in the head of your page:

<script language="Javascript1.2">

// (C) 2003 CodeLifter.com
// Source: CodeLifter.com
// Do not remove this header

// Set the message for the alert box
am = "This function is disabled!";

// do not edit below this line
// ===========================
bV = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"

function nrc(e) {
if (bNS && e.which > 1){
alert(am)
return false
} else if (bIE && (event.button >1)) {
alert(am)
return false;
}
}

document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc;

</script>
In response to National Guardsmen
National Guardsmen wrote:
it wouldnt be html it would be javascript

> ============================================================
> Script: Basic No-Right-Click Script
> Functions: Blocks right-click on mouse and shows alert box
> Browsers: NS & IE 4.0 & later; degrades gracefully
> Author: etLux
> ============================================================
>
> Put the following script in the head of your page:
>
> <script language="Javascript1.2">
>
> // (C) 2003 CodeLifter.com
> // Source: CodeLifter.com
> // Do not remove this header
>
> // Set the message for the alert box
> am = "This function is disabled!";
>
> // do not edit below this line
> // ===========================
> bV = parseInt(navigator.appVersion)
> bNS = navigator.appName=="Netscape"
> bIE = navigator.appName=="Microsoft Internet Explorer"
>
> function nrc(e) {
> if (bNS && e.which > 1){
> alert(am)
> return false
> } else if (bIE && (event.button >1)) {
> alert(am)
> return false;
> }
> }
>
> document.onmousedown = nrc;
> if (document.layers) window.captureEvents(Event.MOUSEDOWN);
> if (bNS && bV<5) window.onmousedown = nrc;
>
> </script>
>


Well,thanks for that code,but how would I make it work without the alerts?
In response to Metamorphman
============================================================
Script: Basic No-Right-Click Script
Functions: Blocks right-click on mouse and shows alert box
Browsers: NS & IE 4.0 & later; degrades gracefully
Author: etLux
============================================================

Put the following script in the head of your page:

<script language="Javascript1.2">

// (C) 2003 CodeLifter.com
// Source: CodeLifter.com
// Do not remove this header

// Set the message for the alert box

// do not edit below this line
// ===========================
bV = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"

function nrc(e) {
if (bNS && e.which > 1){
return false
} else if (bIE && (event.button >1)) {
return false;
}
}

document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc;

</script>


That should do it, but im no wiz at javascript.
Keep in mind that the source of the page can still be retrieved using some kind of special keypress (there should be one), and if not that it can always be accessed by checking the cache.