Creating div on the fly fires twice
<p>I've seen similar posts but nothing that helped me 100%</p>

<p>I need to insert these divs before the first element of the body, on the fly when a specific js file is loaded into the page. I'd like this to fire when the script is loaded, and then add the two divs in front of the existing first child element.</p>

<pre><code>$('&lt;div id="DIV1"&gt;&lt;div id="DIV2"&gt;&lt;/div&gt;&lt;/div&gt;').prependTo('body:first').index();
</code></pre>

<p>I can use the above code in a .js file without an attached function and it works but it fires twice.  I've tried multiple methods of doing this, but pretty much everything I try fires twice so I get two divs instead of 1.  </p>

<p>Can anyone guide me on a better way to do this?</p>

<p>Thanks</p>
