title: replace document in IE modal dialog
body: <p>Browser : IE6/IE7.</p>
  
  <p>I want to load a new document into my html modal dialog, either via a form target or a javascript function.</p>
  
  <pre><code>&lt;html&gt; &lt;!-- quirks mode --&gt;
  &lt;head&gt;
  &lt;script&gt;
  function openModal(url) {
      if(window.showModalDialog)  showModalDialog(url);
      else {
          try {
              netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
              open(url, "", "modal=yes");
          } catch (e) {
              alert("dialog windows unsupported by browser");
          }
      }
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body style="background:red" onload="setTimeout(function(){document.body.style.backgroundColor='white'},100)"&gt;
  &lt;a href="javascript:openModal(location.href)"&gt;Open Modal&lt;/a&gt;
  &lt;form&gt;
  &lt;input type="submit" value="Send Form" /&gt;
  &lt;/form&gt;
  &lt;a href="javascript:location.reload()"&gt;Reload content&lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>In Gecko-based browsers, it works.</p>
  
  <p>In IE, when in the modal dialog window, the form opens a new window (even if I specify the <code>target="_self"</code> attribute), and the javascript reload() fails silently. If I try to do a <code>location.replace(location.href)</code> or <code>location.href=_someurl_</code>, it opens a new window.</p>
  
  <p>So my question : how can I get IE to replace the current document in a modal dialog window?</p>