title: Check if window parent is same domain
body: <p>My problem is that I'm creating an application that will be added to different pages in an iframe. But sometimes it will be on my own domain and sometimes on some one elses.
  And when it is hosted on my own domain I want to be able to call functions outside the frame.</p>
  
  <p>Is it possible to check if the parent window is on the same domain (with javascript/jQuery)?
  At the moment I get this ugly error when trying to access somethin outside my frame when not hosted on my own site:
  "Error: Permission denied to access property 'document'"</p>
  
  <p>Wanna do something like this:</p>
  
  <pre><code>if(window.parent is accessible) {
      // Do special stuff
  } else {
     // Do nothing
  }
  </code></pre>