title: safari ReferenceError: Can't find variable
body: <p>I have the following in its own DIV</p>
  
  <pre><code>&lt;script&gt;
  function newfunc()
  {
  alert("here");
  }
  &lt;/script&gt;
  &lt;button type="button" onclick="newfunc()"&gt;Press me&lt;/button&gt;
  </code></pre>
  
  <p>On IE and FF it works fine, but on Safari (at least Safari 4.0.5) it says “ReferenceError can't find variable” - now the content was loaded into the DIV dynamically and it seems Safari can't see the function definitions within this DIV - however, if I put the function <code>newfunc()</code> onto the main HTML page (i.e. not in the DIV) then the button press does call the function.</p>
  
  <p>It’s as if Safari doesn't see the Javascript functions that have been added to the DIV.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>adam</p>