Why would this javascript not work in IE7 or Safari?
<p>Firefox handles it fine, but Safari and IE7 silently fail and do not insert the element.</p>

<pre><code>&lt;script type="text/javascript"&gt;
  var ul = document.getElementById('xg_navigation').getElementsByTagName('ul')[0];
  ul.innerHTML = '&lt;li id="xg_tab_home" class="xg_subtab"&gt;&lt;a href="http://somedomain.com/"&gt;Some Text&lt;/a&gt;&lt;/li&gt;' + ul.innerHTML;
&lt;/script&gt;
</code></pre>

<p>This is with an exisitng html structure like:</p>

<pre><code>&lt;div id="xg_navigation"&gt;
  &lt;ul&gt;
    &lt;li&gt;&lt;a href="..."&gt;Foo&lt;/a&gt;&lt;/li&gt;
    ...
  &lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p>I dont have control over the HTML, but I do have the ability to insert a snippet of javascript in the page body.</p>

<p>Sadly I appear to be poorly educated on cross browser javascript support.  Do I need to hook it it up via an onPageLoad sort of event somehow?</p>
