Line | |
---|
1 | <html> |
---|
2 | <head> |
---|
3 | <title>dojo.connect() keypress/keydown test</title> |
---|
4 | <script src="../../dojo.js"></script> |
---|
5 | <script> |
---|
6 | require(["dojo/dom", "dojo/on", "dojo/_base/connect", "dojo/domReady!"], |
---|
7 | function(dom, on, connect){ |
---|
8 | connect.connect(dom.byId("textbox"), "onkeypress", function(evt){ |
---|
9 | console.log("keypress event from dojo.connect(): ", evt.type + ", " + evt.charCode + ", " + evt.charOrCode); |
---|
10 | }); |
---|
11 | connect.connect(dom.byId("textbox"), "onkeydown", function(evt){ |
---|
12 | console.log("keydown event from dojo.connect(): " + evt.type + ", " + evt.keyCode); |
---|
13 | }); |
---|
14 | }); |
---|
15 | </script> |
---|
16 | </head> |
---|
17 | <body> |
---|
18 | <h1>dojo.connect() keypress/keydown test</h1> |
---|
19 | <p> |
---|
20 | Test for dojo.connect()'s deprecated code to normalize onkeypress/onkeydown events to behave like mozilla. |
---|
21 | </p> |
---|
22 | <p> |
---|
23 | Type into <input>, and watch console for log messages. |
---|
24 | </p> |
---|
25 | <input id="textbox"> |
---|
26 | </body> |
---|
27 | </html> |
---|
Note: See
TracBrowser
for help on using the repository browser.