Hi,
I have the following problem. I would like to load the content pane from URL:
<div dojoType="dijit.layout.AccordionContainer" sizeMin="20" sizeShare="20" evalScripts="true">
<div dojoType="dijit.layout.AccordionPane" title="Class Hierarchy" href="/treeDiv.html" loadingMessage="Loading Class Tree Hierarchy..." evalScripts="true">
</div>
<div>
<div dojoType="dijit.layout.AccordionPane" title="Class Hierarchy" href="/treeDiv.html" loadingMessage="Loading Class Tree Hierarchy..." evalScripts="true">
</div>
<div>
The URL treeDiv.html have scripts (dojo/method and dojo/connect) and dijit widgets:
<div dojoType="dojo.data.ItemFileReadStore" jsId="classStore"
url="/tree/classTree"></div>
<div dojoType="dijit.Tree" id="addrTree" store="classStore"
childrenAttr="classixes" labelAttr="label" query="{type:'classix'}">
<script type="dojo/method" event="getIconClass" args="item">
return (item && classStore.getValue(item, "icon")) || "mailIconCancel";
</script>
<script type="dojo/connect" event="onClick" args="node">
dojo.xhrGet( {
url: "/showClass/" + node.label,
handleAs: "json",
load: function(response, ioArgs) {
dijit.byId("class_details").setContent(response["class_details"]);
dijit.byId("attributes").setContent(response["attributes"]);
dijit.byId("constraints").setContent(response["constraints"]);
dijit.byId("methods").setContent(response["methods"]);
dijit.byId("activities").setContent(response["activities"]);
}
})
</script>
</div>
url="/tree/classTree"></div>
<div dojoType="dijit.Tree" id="addrTree" store="classStore"
childrenAttr="classixes" labelAttr="label" query="{type:'classix'}">
<script type="dojo/method" event="getIconClass" args="item">
return (item && classStore.getValue(item, "icon")) || "mailIconCancel";
</script>
<script type="dojo/connect" event="onClick" args="node">
dojo.xhrGet( {
url: "/showClass/" + node.label,
handleAs: "json",
load: function(response, ioArgs) {
dijit.byId("class_details").setContent(response["class_details"]);
dijit.byId("attributes").setContent(response["attributes"]);
dijit.byId("constraints").setContent(response["constraints"]);
dijit.byId("methods").setContent(response["methods"]);
dijit.byId("activities").setContent(response["activities"]);
}
})
</script>
</div>
In Firefox everything works fine - the widgets and javascript code are loaded correctly. Unfortunately in Internet Explorer 7 only the widgets are loaded and javascript does not execute. The IE7 does not show any errors, so I suppose that Javascript code is nod loaded.
Best regards,
Grzegorz

odd browser "bug"
try adding a node like <div stlye="display:none;">blah</div> above your datastore node... There is an odd bug or "feature" in browsers where if you have no "static" nodes that aren't parsed out of the document onload... then your script blocks get pulled out of the tree and inserted in a newly created <HEAD> tag. Note that this appears to only happen when XHR'ing incomplete HTML fragments.
-Karl
it works :)
Thanks for fast response and help. It works.
Grzegorz