PDA

View Full Version : link to iframe target



Dextro
20 Feb 2007, 7:37 AM
tree.on('click', function (e){
getEl('content_content').dom.src = node.attributes.href;
});


<iframe id="content_content" name="content_content" frameborder="no">
standaard inhoud in content_content
</iframe>


That's my code that listens to a click event. It all works except the href element opens in a full window and not in the iframe with id 'content_content'. I really don't have a clue what goes wrong.

Dextro
21 Feb 2007, 12:13 AM
Apparently that's not that easy.

reignman
21 Feb 2007, 2:44 AM
it should work if you use node instead of e


tree.on('click', function (node){
getEl('content_content').dom.src = node.attributes.href;
});

perhaps there is also a problem how the browser uses href of treenode...
i alwas use attribute url instead of href :)

greets reignman

Dextro
21 Feb 2007, 6:10 AM
Damn, stupid me. e was node, but not here, I copypasted a wrong testexample. But changing href to url works indeed. Where can I give you a free hug? ;)