How do I get around access denied when trying to view the parent of an IFRAME
So I have this craptastic code that I inherited and an insane client as well. This program uses IFRAMES to emulate AJAX like calls since the previous dev could not be bothered to just do AJAX开发者_高级运维. Anyway, the problem is, is that the app calls a javascript that then sets the source of the IFRAME to some dynamic javascript.
Okay, now at the end of this javascipt, the IFRAME tries to set a value on the parent. But in IE7 and IE8 I get "Permission Denied" errors when trying to access parent.document. I imagine that this is to protect against cross domain security issues, however the parent and the child are in the same domain. The site is all https; I don't know if this makes a difference. Any ideas would be awesome.
Both the parent and the child need to be on the same domain and subdomain. Additionally, if whatever code runs in theiframe
redirects the frame, it would no longer be in the correct domain when it is finished executing.
精彩评论