dojo 1.8: loading dojo-laced html files into conte

2019-09-15 00:31发布

问题:

Hi Any idea how I can load dojo-laced html file dynamically into contentpanes?

I am able to load non-dojo html into content pane using href.

When I loaded dojo-laced html file, I can see text in html tags but not text in dojo scripts. Where did I go wrong?

The scripts I put here are:-

widget.set('href','dojotext.html')

Another problem in jsfiddle is that pressing button 1 will not update, unlike in my environment.

and funny thing is that border container and comtent panes are not displayed, unlike in my environment too.

Here are my links in jsfiddle - main page for testing loading - dojo content to be loaded

Please advise. Thanks Clement

回答1:

First of all, your ContentPanes and BorderContainer are not being displayed because you're not parsing them.

In your code, you can run parser manually:

ready(function () {
    parser.parse();
    // ...
});

Regarding your first question, it seems that you didn't read the documentation:

<div id="foo" data-dojo-type="dijit/layout/ContentPane" href="/some/page.html">
  <script type="dojo/method">
    alert ('Hello World!');
  </script>
</div>

Code from: ContentPane documentation



标签: dojo