开发者

disable right click on a link in visualforce

开发者 https://www.devze.com 2023-03-06 22:28 出处:网络
How to disable right click on a link in visualforce? I am calling the field in a object using select query where it is a lookup. So I provided onclick =\"return false\" but th开发者_如何学Ce link can

How to disable right click on a link in visualforce? I am calling the field in a object using select query where it is a lookup. So I provided onclick ="return false" but th开发者_如何学Ce link can still be opened with a right click.


Have you tried

<body oncontextmenu="return false;">

for this alongside your current code? Although it could be undone by someone in the browser bar using

javascript:void oncontextmenu(null)

or by just viewing the source of the page. I would imagine that 99% of users won't go through those hoops though.

It should also disable right click through the entire page which may be undesirable.

Paul

0

精彩评论

暂无评论...
验证码 换一张
取 消