title: Google spreadsheet without header and footer
body: <p>I want to embed a Google spreadsheet without the header and footer. <a href="https://stackoverflow.com/questions/2123764/remove-header-footer-from-published-google-docs-spreadsheet">This post</a> shows the trick, but doesn't say how to apply it. I tried this, but it doesn't work:  </p>
  
  <pre><code>&lt;iframe id="embeddedthing" width='500' height='300' frameborder='0' src='https://docs.google.com/spreadsheet/pub?key=&lt;DocId&gt;&amp;single=true&amp;gid=12&amp;output=html&amp;widget=false&amp;gridlines=false'&gt;&lt;/iframe&gt;
  &lt;script type="text/javascript"&gt;
    var f = function(id) {document.getElementById(id).style.display = "none";};
    f("header");
    f("footer");
  &lt;/script&gt;
  </code></pre>
  
  <p>Then I thought I should apply it to the document loaded in the iframe, so I tried to access it using <code>document.getElementById('FrameId').contentWindow.document</code>, but the browser says "Unsafe JavaScript attempt to access frame" and doesn't allow me to continue.  </p>
  
  <p>What is the correct way to run that JavaScript function?</p>