title: Window.top and top.document in iframe
body: <p>i have 2 pages, page1.html(mypage), and page2.html(external), page1.html is loading page2.html using iframe. page2.html have basically information of user, it contain menus , forms. There is a logout function with below code</p>
  
  <pre><code>$('#inetLogoutId').click(function(event) {
          var logoutMsg = "Are you sure you want to log out?";
          dialogConfirm(logoutMsg, function() {
              top.document.location.href = path + "/logout";
          })
      });
  </code></pre>
  
  <p>logout not working because of <code>Uncaught DOMException: Blocked a frame with origin "https://example.com" from accessing a cross-origin frame.</code>, what if logout function is modified to <code>window.top.location.href</code>. What's the main difference between these 2.</p>
  
  <p>Thank you</p>