No html displayed in dojo mobile contentpane using href parameter

Go To


i'm trying to implement to parse content from html. But, no text is displayed at all. Here is my html to file to parsed by (filename: fragment1.html):

<div data-dojo-type='' shadow='true'>
  HTML fragment example

And here is my index.html :

<!DOCTYPE html>
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <title>dojox/mobile Demo</title>
        <script src="" data-dojo-config="async: true"></script>
        <script type="text/javascript">

            require(["dojox/mobile/parser", "dojox/mobile", "dojox/mobile/deviceTheme", "dojox/mobile/compat", "dojo/domReady!","dojox/mobile/ContentPane", "dojox/mobile/RoundRect", "dojox/mobile/RoundRectCategory"], function(parser) {


        <div id="main" data-dojo-type="" data-dojo-props="selected: true">
            <h1 data-dojo-type="">Main Menu</h1>
            <ul data-dojo-type="">
                <li data-dojo-type="" data-dojo-props="moveTo: 'view-content'">
                    View Content

        <div id="view-content" data-dojo-type="">
            <h1 data-dojo-type="" data-dojo-props="back:'Main Menu', moveTo:'main'">This is sample content</h1>
            <h2 data-dojo-type="">Pane1</h2>
            <div id="pane1" data-dojo-type="" content="&lt;div data-dojo-type='' shadow='true'&gt;Thank you!&lt;/div&gt;"></div>

            <h2 data-dojo-type="">Pane2</h2>
            <div id="pane2" data-dojo-type="" href="fragment1.html"></div>


Is anyone have solutions? Thanks.

2012-04-04 03:28
by rahmat
rahmat : regarding debug, read - Sebastian Lasse 2012-05-10 13:44


Your fragment looks very similar to the documentation! I think what's going on here is that your parser.parse() line probably gets executed too early; before the external HTML content has been fetched by the ContentPane widget and inserted into the DOM. Have you tried using a debugger to see what's actually in the DOM when this is loaded? What's in the console?

Irrespective, I think you may need to turn on the parseOnLoad: true property on the ContentPane (see the docs). Looks like that will do what you want.

2012-04-26 21:05
by Andrew Ferrier
thanks for your answer @andrew-ferrier. Anyway, as a beginner i have a question. How do I debug dojo script - rahmat 2012-05-08 09:42