Forum Moderators: open

Message Too Old, No Replies

oncontextmenu=return false not working

         

jscjso

10:29 pm on Feb 24, 2010 (gmt 0)

10+ Year Member



I have

<html>
<head>
<meta...>
</head>

<body oncontextmenu="return false" onselectstart="return false" ondragstart="return false">

....

</body>
</html>

People cannot use RIGHT CLICK to select anything espcially the pictures. I know there are ways to get by to copy the content. But I think it is good enough to stop a lot of general public from copying.

However, as I have developed the site to be more complicate and I found out a few days ago that I can click and select the content. I wonder what other feature I added could disable the "return false".

jscjso

9:20 pm on Feb 25, 2010 (gmt 0)

10+ Year Member



I did more tests and found out something new.

The <body oncontextmenu"return false"...> works on Apple Safari and Google Chrome. But not IE, Firefox, or Opera.

That <body...> statements used to work on all browsers
a few months ago.

I want to find a way to prevent RIGHT CLICK on my html for all browsers. Any suggestion is appreciated.

Readie

5:20 am on Feb 26, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are several ready made JavaScripts that do this. You should be able to find one pretty quickly by googling "javascript no right click"

jscjso

8:20 pm on Mar 1, 2010 (gmt 0)

10+ Year Member



Readie,

Thanks.