title: "This webpage could not be saved" error in Internet Explorer 8
body: <p>The short version of my question is "I'm getting an error in Internet Explorer 8 -- how can I change my code to accomplish my task without hitting that error?"</p>
  
  <p>The long version: I've got a website where some dynamically-generated pages have a "save this page" link at the top.  Clicking the link will launch a bare-bones version of the page content (stripping out header and footer, etc) in a smaller pop-up using javascript's window.open().  The popped-up page has menubar=1, so that the user can use File > Save As... and save the page.  (This is a pretty clumsy way to implement saving, but I couldn't find any nicer solutions with sufficiently wide browser compatibility.)</p>
  
  <p>This works fine in every version of Chrome or Firefox I've tested, and in IE9, IE10, and either of those browsers in compatibility mode for 7 or 8.  But users who actually have IE8 are seeing this behavior:</p>
  
  <ol>
  <li>On normal, pretty-styled webpage, click "save this page" link</li>
  <li>On bare-bones popup, go to File > Save As...</li>
  <li>In the Save dialog, select a location and click Save</li>
  <li>Observe save progress bar get up to somewhere beyond 50%, then disappear to be replaced with an error message, the title of which is "Error Saving Webpage" and the full text of which is "This webpage could not be saved."</li>
  </ol>
  
  <p>This happens when saving as "Webpage, complete" or as "Web Archive, single file".  The page <strong>does</strong> save when using "Webpage, HTML only", but I don't expect that our users are going to be familiar with changing that option.</p>
  
  <p>I've Googled around, and have seen a few suggested reasons why a given page would fail to save in IE8.  None apply to this case.</p>
  
  <ul>
  <li><em>An <strong>a</strong> element is missing its href attribute</em> -- my simplified page has no href elements.</li>
  <li><em>An included, cross-domain CSS file is being blocked</em> -- my simplified page has light inline styling, but no CSS files.</li>
  <li><em>There is some javascript code IE doesn't like</em> -- my simplified page has no javascript.</li>
  <li><em>The title of the page is too long</em> -- my title is under 40 characters.</li>
  <li><em>The page was created in Excel</em> -- it wasn't created in Excel, or anything else that might add proprietary or unusual markup.</li>
  </ul>
  
  <p>Our site is used by customers across the United States, so I don't have much control over browser versions, computer setup, et cetera.  Is there something in my code that would cause this, and that could be addressed by my fixing my code instead of needing to figure out a workaround from the user's perspective?</p>
  
  <p>(<strong>Edit to add:</strong> Sorry, I should probably have realized that some suggested answers would involve PHP.  This is a C#/ASP.NET site.)</p>
  
  <p>(<strong>Edit 2:</strong> The page being saved is dynamically generated, so it can't be requested directly from the server in any creative ways like wget.  Right now some AJAX magic happens to produce a string of HTML (specifically a table, each row corresponding to a product on a particular product list that may have already been filtered by the user).  Then a popup is launched with window.open and document.write used to fill that popup with some head matter + the generated table + standard HTML tags like open/close head and body.  This document.write'd popup is what needs to be saved.  The various strings I build up to stick in the document.write call are all made up of printable characters with a couple of minor exceptions:</p>
  
  <ul>
  <li>\n (which was only added to the source to format it nicely for the
  folks here)</li>
  <li>Any non-printable characters that might be in individual product titles/prices/SKUs, pulled from the database (which I'm not sure how to check for, but which presumably aren't in so many different product titles that I can't find one single list that prints correctly in IE8)</li>
  </ul>
  
  <p>Unless document.write itself is doing something hinky, I can't think of a way the written content could be the problem.  Not to say that there's not a way that I just can't think of.)</p>
  
  <p>Full source (now with more opening HTML tag) from one of these troublesome pages follows... File > Save As fails for this when I test in IE8.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;&lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8" /&gt;
  &lt;title&gt;
                  Board &amp;amp; Volunteer Product List
              &lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;p style='font-size: small;'&gt;This page was generated from http://localhost/Training-And-Events/Board-And-Volunteer-Training/Board---Volunteer-Product-List/ on 12-13-2013.&lt;/p&gt;
  &lt;h2&gt;
                  Board &amp;amp; Volunteer Product List
              &lt;/h2&gt;
  &lt;p style='font-size: small;'&gt;Filtered by: Equipment. &lt;/p&gt;
  
  &lt;table style="width: 100%; border: 0; padding: 0;"&gt;
  
  &lt;tr&gt;
      &lt;td style='width: 80%;'&gt;&lt;b&gt;&lt;u&gt;Title&lt;/u&gt;&lt;/b&gt;&lt;/td&gt;
      &lt;td style='width: 10%;'&gt;&lt;b&gt;&lt;u&gt;SKU&lt;/u&gt;&lt;/b&gt;&lt;/td&gt;
      &lt;td style='width: 0%;'&gt;&lt;/td&gt;
      &lt;td style='width: 10%;'&gt;&lt;b&gt;&lt;u&gt;&lt;span style='text-align: right;'&gt;Price&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;&lt;td colspan=4 style="border-bottom: 1px solid #dddddd; line-height: 3px;"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;
      &lt;td style='width: 80%;'&gt;Passageways&lt;/td&gt;
      &lt;td style='width: 10%;'&gt;&lt;/td&gt;
      &lt;td style='width: 0%;'&gt;&lt;/td&gt;
      &lt;td style='width: 10%;'&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>