title: What does Meteor do to my Javascript scopes when using the object tag to include a file?
body: <p>I am looking at meteor for an application which uses interactive SVG files included using the object tag.</p>
  
  <p>I have a running prototype using static html/js/SVG files, where I can click an entity in the SVG and have a Javascript belonging to my html page get executed.</p>
  
  <p>But when I adapt this prototype to be published with meteor something happens to the Javascript scopes, and the result is I can't find the html page Javascript functions from within the SVG anymore.</p>
  
  <p>Basic structure of the meteor version is as follows. </p>
  
  <p>app.html:</p>
  
  <pre><code>&lt;head&gt;
    &lt;title&gt;test&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;div id="mySVG" class="container"&gt;
      &lt;object data="test.svg" type="image/svg+xml"&gt;&lt;/object&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>test.svg (placed in the /public folder):</p>
  
  <pre><code>&lt;svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:se="http://svg-edit.googlecode.com" xmlns:xlink="http://www.w3.org/1999/xlink"&gt;
      &lt;title&gt;networktest&lt;/title&gt;
      &lt;g&gt;
      ...graphics...
      &lt;/g&gt;
  
      &lt;script&gt;
      document.getElementById("foo").addEventListener("click", sendClickToParentDocument, false);
  
      function sendClickToParentDocument(e)
      {
          if( window.parent.foo)
                  window.parent.foo( e.target );
              else
                  alert("Bar!");
      }
      &lt;/script&gt;
  &lt;/svg&gt;
  </code></pre>
  
  <p>app.js:</p>
  
  <pre><code>function foo( target ) {
      // ... do stuff ...
  }
  </code></pre>
  
  <p>Now in the meteor version I get the "Bar" alert, not the call to foo().
  I have placed a breakpoint in the .js that defines the foo() function, and it gets called on page load, so that's OK. But apparently it does not end up in the same place as when I run using static files.</p>
  
  <p>How can I find it from inside the SVG?</p>