title: Access to svg's scripts
body: <p>svg is an xml based graphics and you can add JavaScripts to it. I have tried to access to the script functions defined in a svg. The script in my svg is something like this:</p>
  
  <pre><code>&lt;svg ... onload="RunScript(evt);"...&gt;
  &lt;script type="text/javascript"&gt;
  ...
  function RunScript(loadEvent) {
    // Get object in my html by id
    var objElement = top.document.getElementById('objid1');
    if (objElement)
    {
      // Extend object tag object's methods
      objElement.SVGsetDimension  = setDimension;
      ...
    }
    function setDimention(w, h) {...}
  </code></pre>
  
  <p>In my main html file, the svg is embedded in an object tag like this:</p>
  
  <pre><code>&lt;object id="objid1" data="mygrahic.svg" ... &gt;
  &lt;a href="#" onclick="document.getElementById('objid1').SVGsetDimention(10, 10);
     return false;"
  ...&gt;Set new dimention&lt;/a&gt;...
  </code></pre>
  
  <p>This one works fine. However if the svg xml file is referenced by a full URL (on another site) like this:</p>
  
  <pre><code>&lt;object id="objid1" data="http://www.artlibrary.net/myaccount/mygrahic.svg" ... &gt;
  </code></pre>
  
  <p>the codes do not work any more. It looks like that I cannot attach the method defined in my svg script to a method in my main html object tag element, or the top or document is not available in this case, or getElementById(..) just cannot find my object element in my svg script. Is there any way I can do in the svg xml script to find my html element?</p>
  
  <p>Not sure if this problem is caused by the different DOMs, and there is no way for my svg script codes to figure out another DOM's object or element. It would be nice if there is any solution.</p>