<script type=”text/JavaScript”>
//方法一:
location.href=’https://www.home1024.com/article/网址’;
//方法二:
document.write(‘<a href=”https://www.home1024.com/article/网址”>文字</a>’);
</script>
2,应用到Ext中的树控件事件处理
tree_03.js
实现代码如下:
Ext.onReady(function(){
var root = new Ext.tree.TreeNode({ //tree,这里没有function,使用json格式
id:1,
text:”linjq”
});
var c1 = new Ext.tree.TreeNode({
text:”child 1″
});
root.appendChild(c1);
root.appendChild(new Ext.tree.TreeNode({
text:”child 2″}));
var tree = new Ext.tree.TreePanel({
width:100,
renderTo:”content”,
root:root
});
// c1.on(“click”,function(node,event){alert(node.text);});
// c1.on(“click”,function(){document.write(‘<a href=”https://www.home1024.com/article/index.jsp”>index.jsp</a>’)});
c1.on(“click”,function(){location.href=”https://www.home1024.com/article/index.jsp”});
});
实现代码如下:
<link type=”text/css” rel=”stylesheet” href=”https://www.home1024.com/article/ext/resources/css/ext-all.css” />
<script type=”text/javascript” src=”https://www.home1024.com/article/ext/adapter/ext/ext-base.js”></script>
<script type=”text/javascript” src=”https://www.home1024.com/article/ext/ext-all.js”></script>
<script type=”text/javascript” src=”https://www.home1024.com/article/tree_03.js”></script>
</head>
<body>
<div id=”content”></div>
</body>
以上就是【Ext javascript建立超链接,进行事件处理的实现方法】的全部内容了,欢迎留言评论进行交流!
© 版权声明
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!邮箱:cxysz1@tom.com
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
8. 精力有限,不少源码未能详细测试(解密),不能分辨部分源码是病毒还是误报,所以没有进行任何修改,大家使用前请进行甄别
丞旭猿论坛
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
8. 精力有限,不少源码未能详细测试(解密),不能分辨部分源码是病毒还是误报,所以没有进行任何修改,大家使用前请进行甄别
丞旭猿论坛
THE END
暂无评论内容