Click to See Complete Forum and Search --> : Does anybody know the code to stop people from right clicking on my site?


crazymicegirl
08-11-2003, 09:52 AM
Does anybody know the code to stop people from right clicking on my site?:confused:

FlyByProgrammer
08-11-2003, 10:28 AM
Here's the code to stop right click:


<html>
<head>
<script type="text/javascript">
function disable()
{
if (event.button == 2)
{
alert("Sorry no rightclick on this page.\nYou cannot view my source\nand you cannot steal my images.")
}
}

</script>
</head>
<body onmousedown="disable()">

</body>
</html>



It is taken from http://www.w3schools.com/

Robert Wellock
08-11-2003, 10:35 AM
Close this topic quick because if I disable JavaScript on my browser the above fails…

brendandonhue
08-11-2003, 10:39 AM
Search the forums...this has been discussed dozens of times. In the end, just about any method of stopping right clicks or protecting your client-side source code will backfire or can be gotten around with 2 minutes of effort.