Note that there are some explanatory texts on larger screens.

plurals
  1. POdijit.byId return undefined
    primarykey
    data
    text
    <p>It's very strange, I call dijit.byId() in dojo.addOnLoad(function{...}), it return undefined. In order to check if the id exist, i call dojo.byId() at the same time, it return some object. So I guess the component is not a dijit component? this is the whole code: Please help me, thanks in advice!</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;title&gt;&lt;/title&gt; &lt;!-- Dojo/Diji definations --&gt; &lt;link href='../dojoroot/dijit/themes/tundra/tundra.css' type='text/css' rel='stylesheet'/&gt; &lt;link href='../dojoroot/dojo/resources/dojo.css' type='text/css' rel='stylesheet'/&gt; &lt;script type="text/javascript" src="../dojoroot/dojo/dojo.js" djConfig="parseOnLoad: true"&gt;&lt;/script&gt; &lt;!-- Main scripts --&gt; &lt;script type="text/javascript"&gt; dojo.addOnLoad(function() { // Include library dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.TabContainer"); dojo.require("dijit.layout.ContentPane"); // add the select child event to the tab panel alert(dijit.byId("contentTabPanel")); // return no defined alert(dojo.byId("contentTabPanel")); // return an object }); &lt;/script&gt; &lt;/head&gt; &lt;body class="tundra"&gt; &lt;div dojoType="dijit.layout.BorderContainer" style="width: 100%; height: 100%;"&gt; &lt;!-- Content Tab Panel --&gt; &lt;div id="contentTabPanel" dojoType="dijit.layout.TabContainer" region="center"&gt; &lt;!-- Tab UserGroup --&gt; &lt;div dojoType="dijit.layout.ContentPane" title="UserGroup"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>OMFG!!!!! I know the reason!!!!! I cost 5 Hours just for this STUPID error:</p> <p>I MUST write the </p> <pre><code> // Include library dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.TabContainer"); dojo.require("dijit.layout.ContentPane"); </code></pre> <p>outside the dojo.addOnLoad(function() { !!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload