title: Javascript inside svg not working on phantomJs
body: <p>I have an svg file with javascript inside for handling click events.
  It works fine in browsers, but it is not working with phantomJS.</p>
  
  <p>If I put the script outside the <code>&lt;svg&gt;&lt;/svg&gt;</code> it works but I want to let the script inside the svg block</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p><strong>WORKING</strong></p>
  
  <pre><code>&lt;body&gt;
    &lt;svg viewBox="0 0 1000 550"&gt;
      &lt;svg id="secondSVG" width="700px" height="550px"&gt; 
        &lt;rect id="arect" height="250" width="250" x="100" y="0"&lt;/rect&gt;
      &lt;/svg&gt;
    &lt;/svg&gt;
    &lt;script&gt;
      window.onload = function() {
      console.log("It is working");}
      document.getElementById('arect').setAttribute('fill', #000000);
    &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>NOT WORKING</strong></p>
  
  <pre><code>&lt;body&gt;
    &lt;svg viewBox="0 0 1000 550"&gt;
      &lt;svg id="secondSVG" width="700px" height="550px"&gt; 
        &lt;rect id="arect" height="250" width="250" x="100" y="0"&lt;/rect&gt;
        &lt;script type="text/javascript"&gt;&lt;![CDATA[
          window.onload = function() {
          console.log("It is working");}
          document.getElementById('arect').setAttribute('fill', #000000);
        ]]&gt;&lt;/script&gt;
      &lt;/svg&gt;
    &lt;/svg&gt;
  &lt;/body&gt;
  </code></pre>