Executing javascript inside div
<p>Question updated. Update at the bottom-</p>

<p>I have to put script on a page. Unfortunately, I don't have control over the header or footer or even the body tag. All, I have is a set of inner html that goes inside a wrapping DIV which sits inside the body tag. Something like this:</p>

<pre><code>&lt;body&gt;
     &lt;div id="wrap"&gt;
         &lt;!-- My controlled content --&gt;
     &lt;/div&gt;
&lt;/body&gt;
</code></pre>

<p>Now, I have to place some javascript. So, I obviously put it inside the section that I control. The problem is that the javascript is not being executed. I even put an alert but there is NO alert box popping up. The final code looks something like this:</p>

<pre><code>&lt;body&gt;
     &lt;div id="wrap"&gt;
         &lt;div id="mycontent"&gt;
              &lt;script type="text/javascript" language="javascript" src="somesource"&gt;&lt;/script&gt;

              &lt;script&gt;
                  var x, y; 
                  //Do something here with x,y;
                  alert("hello");
              &lt;/script&gt;
         &lt;/div&gt;
     &lt;/div&gt;
&lt;/body&gt;
</code></pre>

<p>Any idea what could be wrong? And how I can fix it?</p>

<p>Thanks.</p>

<p>UPDATE: I am not sure if this makes any difference, but I forgot to mention that all this HTML is present inside a frame tag (under a frameset). Will that make a difference?</p>
