The .js file should look like this:
Code:
//Disable right click script III- By Renigade(renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com
var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return
false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all))
{
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
(as Nile suggested).
If it still doesn't work, then post a link to your page so we can see what's wrong. With just the code it's hard to tell what is not correct.
Also, this script is basically useless. More importantly, it's annoying. There is no case where you can actually stop people from doing things on the website (like saving images, viewing the source code, etc), so adding this will just annoy people because it will stop them from doing normal things (like right click > bookmark this page, or right click > open link in new window). You can use it if you want, but usually it's a mistake.
The only times when this is actually useful is when you want to do something ELSE when you right click, such as adding a custom right click menu for a web-app. But even then there are problems with compatibility, etc.
Bookmarks