PDA

View Full Version : Disable right click script



Engravers R_Us
04-29-2008, 08:38 PM
1) Script Title: Disable right mouse click script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex9/noright.htm

3) Describe problem: I have looked at all the threads and may have over looked the answer to what I need to know. If so I'm sorry.:confused:
I am trying to use your script code on y web page:
<script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// -->
</script>

I have designed my web page with Word 2000. Your web site says to copy the code and past it to the <BODY>. I am new to web design. Does the <BODY> mean the main index page? If so do I aste the code at the botton of the index page perhaps below the web counter code? Do I need to put this code on each web page in my master web files, or just the main index page?

I really hope this code works:(, I have had to take off all my custom engraved designs because some have been taken from my web site already:mad:.

Thank You

jscheuer1
04-30-2008, 05:02 AM
No the body is a section of the source code of the page. This is best done in a text only editor like NotePad. But the script is worthless, I guarantee it. So, if you want to start learning about javascript, choose another script, but stick to something simple.