开发者

Keyboard events in IE9 html explorer bar

  • Claim: Keyboard events aren't dispatched in IE9 html explorer bars.
  • Proof: Try running the HTML below in an IE9 html explorer bar.
  • Expected: an alert should be shown after pressing a key anywhere on the document (of the explorer bar - note that this alert is shown by loading this HTML into a normal IE9 tab).
  • Actual: nothi开发者_如何学Cng happens.
  • The question is: can an IE9 html explorer bar be configured to enable keyboard event handling?

The HTML:

<!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>IE9</title>
    </head>
    <body>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.js"></script>    
        <script>
        $(document).ready(function() {
            alert("before event registration");
            $(document).keydown(function() { alert("inside event handler"); });
        }); 
        </script>    
        </body>
    </html>


After re-checking the issue on my colleagues' machines I found out that it doesn't reproduce there - it's specific to my machine and sounds like a "glitch". That made me happy.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜