Dojo事件处理

dexia115 2010-04-22

<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<html><head>
<script type="text/javascript" src="dojo-release-1.4.2/dojo/dojo.js"
 djConfig="isDebug:true,parseOnload:true">
 </script>
<script type="text/javascript">
function echo(event) {
    key=event.charCode;
    console.debug(event.charCode);
}
function foo(event) {
    dojo.stopEvent(event);
    console.debug("超级链接单击了!");
}
dojo.addOnLoad(function() {
       interactiveNode=dojo.byId("interactive");
       linkNode=dojo.byId("link");
       dojo.connect(interactiveNode, 'onkeypress', echo);
       dojo.connect(linkNode, 'onlick', foo);
       });
</script>
</head>
<body>
<a href="http://www.baidu.com" id="link">Dojo</a>is great.
<form><label for="infield">请输入信息:</label><input id="interactive" type="text" name="infield"/></form>
</body>  </html> 

黑体部分好像没有实现其功能!          

Global site tag (gtag.js) - Google Analytics