Note that there are some explanatory texts on larger screens.

plurals
  1. POTrouble with Cross Domain Iframes on IE8: changing parent.location forces new popup window. if on a click event, it works as expected
    primarykey
    data
    text
    <p>I'm having a lot of trouble getting cross domain iframe communication working. </p> <p>It's working on Firefox and Chrome, but on Internet Explorer, it only works in <strong>some</strong> ways:</p> <p>If the <code>parent.location = 'new_hash';</code> is not encompassed in an onClick event, it forces the parent frame to open a new popup window. If it is in an onClick event, the cross domain fragment identifier trick works. What gives?</p> <p>Sounds like I need to <strong><em>understand</em></strong> javascript.. </p> <hr> <p><strong>Edit to comments:</strong> parent.location.href and parent.location have the same behavior.</p> <p>It seems to be my specific browser IE 8.0.7600.16385 reading the hash change as a popup. I'd like to hear if anybody else has experienced something like this. </p> <h2>Creates popup in parent:</h2> <pre><code>&lt;script type="text/javascript"&gt; parent.location = 'http://example.com#new_hash'; &lt;/script&gt; </code></pre> <p>shows a "popup blocked" dialog in IE8. If I let the popups open, they infinitely open popups.</p> <h2>Does not create popup in parent:</h2> <pre><code>&lt;a onClick="parent.location='http://example.com#new_hash'"&gt;clicky&lt;/a&gt; </code></pre> <p>or</p> <pre><code>$(function() { $("mybutton").click( function() { parent.location='http://example.com#new_hash'; }); </code></pre> <p>Does not create popup in parent.</p> <h2>My real example</h2> <p>Mine needs the parent.location=newhash to fire when its own hash has a certain value. I essentially have a :</p> <pre><code>setInterval(function() { if (location.hash == 'something') { parent.location='http://example.com#new_hash'; } }, 500); </code></pre> <p>What's going on? How can I tackle this problem? Why does it work when tied to a click event but not if the statement runs on its own? The specific example i'm working on is at <a href="http://www.grovemade.com/products/test" rel="nofollow noreferrer">http://www.grovemade.com/products/test</a> at v.04</p> <p>I'm actively messing around here so it may become outdated..</p> <p><strong>On Firefox and Chrome,</strong> the parent frame is modified from no hash, to #xdm-success, to #handshake-complete. </p> <p>On IE8, #xdm-success forces a new page to open.</p> <p>Thank you!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload