Disable JavaScript keypress events in iframes - Stack Overflow

How do I disable the support for JavaScript keypress events in iframes?I need keypress events disabled

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 badges
Add a ment  | 

1 Answer 1

Reset to default 5

Does 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745208228a4616694.html

相关推荐

  • Disable JavaScript keypress events in iframes - Stack Overflow

    How do I disable the support for JavaScript keypress events in iframes?I need keypress events disabled

    10小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信