Forum Moderators: open

Message Too Old, No Replies

No right click javascript

How do you make a no right click javascript

         

amythepoet

11:50 am on May 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

I'd like to know how to make a no right click javascript.

Any help would be greatly appreciated.

rocknbil

6:35 pm on May 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Amy, the best help to be offered here is Do Not Do This. Right-clicking has many other functions - for example, my favorite is to right-click a link and open in a new window. Personally this really miffs me when someone disables the right-click intending to protect images.

It doesn't even protect them anyway. If someone wants that image there are a number of ways to save it to disk and steal it regardless of all the hoops you create to jump through.

The best protection for this is a solid copyright notice, which is not legally necessary but informs the user that image theft will be prosecuted.

zangs

11:20 am on May 11, 2006 (gmt 0)

10+ Year Member



Hello Dear,
I have you solution.
copy this code on you page...
:)

<script>
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")
</script>

rocknbil

8:59 pm on May 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Document.layers has been deprecated for years!
Look away. Don't do it. :-D

kaled

12:04 am on May 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Anyone smart enough to be able to make use of stolen images is smart enough to switch off javascript to get them.

Kaled.