Make Firefox refresh after changing fragment from an iframe

1k Views Asked by At

My code is in an iframe from a different domain, and I want to trigger a page refresh on the parent after changing the fragment of the URL (also of the parent). It happens on IE, but not on Firefox. Is there any way of doing it without changing the outer document (polling e.g.)?

<a href="http://top.domain.com/#fragment" target="_top">click me</a>

In IE this works fine, the outer frame reloads after clicking this link. Not so in Firefox.

I have already tried with a window.parent.location.reload(true), permission denied.

Thanks!

2

There are 2 best solutions below

0
On BEST ANSWER

Well, this is what I finally did. Although it is not an optimal solution, at least it works: I force a reload of the parent by passing a dummy parameter with a timestamp on it, like this:

<a href="http://top.dom.com/?dummy=13758#frag" target="_top" id="link">click</a>

Generated with something like:

$("#link").attr("href", "http://top.dom.com/?d="+(new Date().getTime())+"#frag");

This is ugly as hell, but at least it works

2
On

You can use meta refresh, or utilize another language like php which can do a header redirect.