EXT JavaScript establishes hyperlinks and implements the method of event handling _yui. Ext Related

Source: Internet
Author: User
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>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.