admin管理员组文章数量:1415145
How do I disable the support for JavaScript keypress events in iframes?
I need keypress events disabled only in specific iframes, so doing a catch-all-events-and-make-em-do-nothing solution is not an option.
How do I disable the support for JavaScript keypress events in iframes?
I need keypress events disabled only in specific iframes, so doing a catch-all-events-and-make-em-do-nothing solution is not an option.
Share Improve this question asked Nov 30, 2008 at 14:07 cllpsecllpse 21.7k37 gold badges133 silver badges170 bronze badges1 Answer
Reset to default 5Does this example does what you want ?
According to this thread, something along the line of:
document.getElementById('edit').contentWindow.addEventListener('keypress', cK, true);
helps capturing keypress in a given iframe. If they can be captured, they can be disabled.
Warning: as pointed out by Allain Lalonde in the ments:
This will work if the iframe's content isn't from another domain.
本文标签: Disable JavaScript keypress events in iframesStack Overflow
版权声明:本文标题:Disable JavaScript keypress events in iframes - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745208228a2647740.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论