/    Sign up×
Community /Pin to ProfileBookmark

Reloading parent page from a iframe pop

Hello.

Im having a bit of a dilema.

Im opening a pop up window from inside an iframe.
The popup contains this code

[code=php]<script language=”JavaScript” type=”text/javascript”>

var myTimeout=setTimeout(“closeWindow()”,3000);

function closeWindow() {
window.opener.location.reload();
window.close();
}
</script>[/code]

This closes it and reloads the iframe, but what I want it to do is reload the entire page that the iframe is on instead.

Any ideas? Thank you.

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisMar 12.2003 — Instead ofwindow.opener.location.reload();[/quote]
Trywindow.opener.[b]top.[/b]location.reload();
Copy linkTweet thisAlerts:
@The_JonathanauthorMar 12.2003 — Well, I feel moronic now...

I cant believe I didnt try that, I tried

window.opener.top.reload();[/QUOTE]

And just about everything else, and I almost tried that one, but I gave up and came here...

Thank you very much.
Copy linkTweet thisAlerts:
@The_JonathanauthorMar 12.2003 — Ive come across an odd problem.

It works on every page on my site, but when I go to a page in the forums with a url such as this

index.php?&act=ST&f=2&t=2&st=0&[/QUOTE]

It no longer works, the pop up just stays, it never closes and the page doesnt refresh.

Any Ideas why?
Copy linkTweet thisAlerts:
@The_JonathanauthorMar 12.2003 — This is really odd, sometimes this will work perfectly, but then then for apparantly no reason itll just stop working. It starts giving me a Permission denies error, and as soon as it does it once it wont work anwhere else on my site... even though it did just a few minutes before.

Any reason this is happening? Any ideas how to fix it?

Thanks.
Copy linkTweet thisAlerts:
@gil_davisMar 12.2003 — "Access Denied" is a security warning that you are trying to script across domains. If you ever load a page that is not in the same domain, you get stuck in that condition until you start over.
Copy linkTweet thisAlerts:
@The_JonathanauthorMar 12.2003 — I see, so even though its on the same server if its called in one of the forums pages it thinks its a seperate server and will make it inactive across the rest of my site. Damn.

I wonder why it does that, and why it only messes it up only on the forums pages.
×

Success!

Help @The_Jonathan spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...