0

I have 2 html pages A and B. Page A has a dojox/layout/contenpane as follows:

<div id="foo" data-dojo-type="dojox/layout/ContentPane" data-dojo-props="renderStyles:true, executeScripts:true"></div>

I am loading the page B inside A using the href attribute of the ContentPane (uses XHR). Page B does show in the ContentPane, but I have 2 problems with this:

1) Page B body tag has a class="claro" attribute which is ignored. (I realized this by comparing the B loaded inside A against just B loaded in a separate browser tab). How do I make this work?

2) The included styles in B overwrite that of the parent page (eg. Body of A has margin:auto, and that of B has margin:0. When I load the ContentPane in A with B, everything in the A shifts from center to left). How do I confine the styles of B just to itself.

I tried looking online for several hours, but I am not making any progress. Any help is appreciated.

4

1 回答 1

1

您应该只在 contentPane 中加载页面 B 的内容,不包括标题和正文标记。

这是通过将 extractContent 设置为 true 来完成的:

<div id="foo" data-dojo-type="dojox/layout/ContentPane" data-dojo-props="renderStyles:true, executeScripts:true, extractContent:true"></div>

样式必须在您的页面 A 的 CSS 中完成。

于 2013-07-02T14:24:33.150 回答