1, how to create hyperlinks in Javasript
<script type= "Text/javascript" >
Method One:
location.href= ' URL ';
Method Two:
document.write (' <a href= ' url ' > Text </a> ');
</script>
2, apply to the tree control event handling in Ext
Tree_03.js
Copy Code code as follows:
Ext.onready (function () {
var root = new Ext.tree.TreeNode ({//tree, there is no function, using JSON format
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= ' index.jsp ' >index.jsp</a> ')});
C1.on ("click", Function () {location.href= "index.jsp"});
});
Copy Code code as follows:
<link type=" text/css "rel=" stylesheet "href=" ext/resources/css/ Ext-all.css "/>
<script type=" Text/javascript "src=" Ext/adapter/ext/ext-base.js "></script>
& Lt;script type= "Text/javascript" src= "ext/ext-all.js" ></script>
<script type= "Text/javascript" src= "Tree_03.js" ></script>
<body>
<div id= "content" ></div>
& L T;/body>