当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Dojo contentPane reload new content from urls

问题描述:

I am creating an application where I programmatically create a tabContainer with several contentPanes as children, these contentPanes load their content via their href attribute, how can I make sure that any and all links contained within these external pages reload in their parent contentPane?

网友答案:

I think the only way you could really do this is:

  1. When the tab loads, query its dom for links: dojo.query('a', tabNode)
  2. Process all the links, take their href target
  3. Set the href to "#"
  4. Use the original href target value in an onclick handler that sets the parent content-pane to that value

Of course, you could do this from the server if you control all the links that are generated there.

Let me know if you need help on any of the code for this.

When you have the link element in hand, you can get its containing widget with:

dijit.getEnclosingWidget( /* DOMNode */ node)
分享给朋友:
您可能感兴趣的文章:
随机阅读: