Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to insert a div before another div?
    text
    copied!<p>This my HTML code:</p> <pre><code>&lt;div id="contextToolBar" class="dijitToolbar xwtContextualToolbar" wairole="menubar" role="menubar" widgetid="contextToolBar"&gt; &lt;table class="xwtContextualToolbarRibbonContainer" cellspacing="0" cellpadding="0" border="0" dojoattachpoint="_contextualToolbarTable"&gt; &lt;tbody class="xwtContextualToolbarRibbonContainerTB"&gt; &lt;tr class="xwtContextualToolbarRibbonContainerTR"&gt; &lt;td&gt; &lt;/td&gt; &lt;td class="xwtContextualToolbarRibbonContainerTD" vertical-align="top" cellspacing="0" cellpadding="0"&gt; &lt;/td&gt; &lt;td vertical-align="top"&gt; ***&lt;div class="xwtQuickFilter" dojoattachpoint="quickFilterNode"&gt;*** &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; </code></pre> <p>I want to add another div before and I am doing following in my JS:</p> <pre><code>var flagId =dojo.query("#contextToolBar .xwtContextualToolbarRibbonContainer .xwtContextualToolbarRibbonContainerTB .xwtContextualToolbarRibbonContainerTB .xwtQuickFilter"); var n = dojo.create("div", { id: "informationDialog", dojoType: "dijit.form.Button", iconClass: "xwtContextualIcon xwtContextualAddRow", showLabel: "false", onclick: "return showClusterInstallationDialog();" }, flagId, "first"); </code></pre> <p>But I am getting a <code>TypeError: doc is undefined</code>. I think I am not getting a <code>flagId</code> properly. What have I done wrong?</p> <p>I then tried to use <code>domConstruct.create</code> instead of <code>dojo.create</code> as well, but it gave me error as <code>undefined</code>.</p>
 

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