简体   繁体   中英

Reloading or redirecting the parent from a child iframe in safari

I am generating an iFrame that following some processing with the frame (from an external site) redirects back to my domain (within the iframe), which should then reload the parent frame. However I've tried multiple ways of calling the parent, but none of them seem to work in safari?

methods use include.

self.parent.location="/";
self.top.location="/";
self.top.location.reload();

all of these just reload the iframe. it feels like it is losing the parent / top reference due to the redirects within the iframe.

Actually I've encountered this problem before and I believe the root of the issue is that this is a browser-security related issue. Try this -- it worked for me:

var reloadParent = self.parent.location.reload();;
setTimeout("reloadParent", 500);

Hope this works for you.

这行不通吗?

parent.parent.location.reload(true);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM