title: Access Parent Windows URL from Modal Dialog : Javascript
body: <p>What is the correct syntax for getting the URL (Specifically, the PATH) of the parent window from a modal dialog box in Internet Explorer. </p>
  
  <p>I have tried numerous variations on:</p>
  
  <pre><code>window.opener.document.location
  window.opener.location
  this.opener.document.location
  window.opener.location.pathname
  window.opener.document.location.pathname
  </code></pre>
  
  <p>But all of them result in an IE javascript error: "Document is null" or "location is null"#</p>
  
  <p>As a side note, in Chrome and FF, this line works fine:</p>
  
  <pre><code>window.opener.location.pathname
  </code></pre>
  
  <p>and in IE, this line is fine for the CHILD windows PathName</p>
  
  <pre><code>document.location.pathname
  </code></pre>
  
  <p>Seems it is something to do with "opener" ?
  I have also tried a suggestion of changing security settings in IE. THis also failed - besides, this wouldn't be an appropriate fix for clients!</p>
  
  <p>Edit: Just tried <code>window.opener.newMethod()</code> and linking it to a method in the parent page. This returned an error too. Its definately the way the parent is being called!</p>
  
  <p>I am basically in need of checking if the parent page is /somepage.aspx and then send a "document.forms[0].submit()" to force a refresh</p>
  
  <p>Edit: Restrictions mean I cannot implement anything other than a Modal Dialog</p>