title: JavaScript: Read URL of parent page
body: <p>I have a page that is loaded inside. The application including this page is located on another domain. So the domain of my page and the application rendering it inside an iframe are located on different domains. The page inside iframe reads the URL it is loaded from to store in the database. The page loading has a hash in the URL.It is like:</p>
  
  <pre><code>https://www.somedomain.com/organizers/list/#type=current&amp;sort=bydate
  </code></pre>
  
  <p>I am reading the URL from mypage. It is located on:
      <a href="https://www.someotherdomain.com/organizers/#sample" rel="nofollow noreferrer">https://www.someotherdomain.com/organizers/#sample</a></p>
  
  <pre><code>var _url = document.referrer
  </code></pre>
  
  <p>The above code gives me the URL but only till <strong>"<a href="https://www.somedomain.com/organizers/list/" rel="nofollow noreferrer">https://www.somedomain.com/organizers/list/</a>", "#type=current&amp;sort=bydate"</strong> is missing. I need that else this code is of no use to me. Is there a way I can read the complete URL without missing any segment?</p>