Dynatree will by default remove the <a>
tags, so it is possbly easier to implement the onActivate handler:
onActivate: function(node) {
if( node.data.href ){
// use href and target attributes:
window.location.href = node.data.href;
// window.open(node.data.href, node.data.target);
// $("#div").load(node.data.href);
}
}
Starting with release 1.1.2, Dynatree will use href
and target
attributes directly from the <a>
tag:
<li id="x"><a href="b">Child node 1-2</a></li>
In older versions you have to set href like so:
<li id="x" data="href: 'b'"><a href="b">Child node 1-2</a></li>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…