是否可以禁用右键单击iframe? [英] Is it possible to disable right click on an iframe?

查看:96
本文介绍了是否可以禁用右键单击iframe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以禁用iframe上的右键单击?
我知道iframe中的文件可能位于同一个域中,但我想知道如果框架中的文件来自外部网站是否可以完成?

Is it possible to disable right click on an iframe? I know it might be possible if the file in the iframe resides in the same domain,but i was wondering if it could be done if the file in the frame was from an external site?

谢谢

推荐答案

您无法真正禁用上下文菜单。 您只能构建脆弱的路障以防止人们调用它。但事实上,这是一个外部iframe只会使问题复杂化。不,您无法阻止用户激活iframe上下文菜单。对不起。

You can't really disable the context menu to begin with. You can only construct fragile barricades to keep people from invoking it. But the fact that this is an external iframe only compounds the issue. No, you can't keep the users from activating the context menu on your iframe. Sorry.

这篇关于是否可以禁用右键单击iframe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆