title: Writing to a new window with javascript... get access denied
body: <p>I have been struggling with this for a while now, and decided it was time to ask for help.</p>
  
  <p>I am trying to create a print function on an aspx page, and I am using javascript to do this:</p>
  
  <pre><code>        function PrintContentCell() {
          var display_setting = "toolbar=yes, location=no, directories=yes, menubar=yes,";
          display_setting += "scrollbars=yes, width=750, height=600, left=100, top=25";
  
          var content_innerhtml = document.getElementById("testTable").innerHTML;
  
          var document_print = window.open("Loading.htm", "", display_setting);
          document_print.document.open();
          document_print.document.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;Print&lt;/title&gt;&lt;/head&gt;');
          document_print.document.write('&lt;body style="font-family:verdana; font-size:12px;" onLoad="self.print();self.close();" &gt;');
          document_print.document.write(content_innerhtml);
          document_print.document.write('&lt;/body&gt;&lt;/html&gt;');
          document_print.print();
          document_print.document.close();
          return false;
      }
  </code></pre>
  
  <p>I get "Access Denied" when the script tries to write to the new window. The Loading.htm file is just a very slim html document writing out the text "Loading...". I had hoped this would work after reading this thread: <a href="https://stackoverflow.com/questions/735136/ie-6-7-access-denied-trying-to-access-a-popup-window-document">IE 6/7 Access Denied trying to access a popup window.document</a></p>
  
  <p>Anybody can help?</p>