Is it possible to change iframe src using javascript exists in page inside that iframe?

Posted by Amr ElGarhy on Stack Overflow See other posts from Stack Overflow or by Amr ElGarhy
Published on 2010-06-16T14:54:56Z Indexed on 2010/06/16 15:32 UTC
Read the original article Hit count: 146

Filed under:
|
|
|

I want to change the iframe source when something change in this iframe content, the iframe is in a different domian than the parent page. is this can be done or not?

I just need to add a hash to this iframe src, so that i can access this hash value from the parent page and do some stuff based on this value.

What i did:
In the iframe page i wrote: window.location.hash = "close_child";
and in the parent page i wrote: if (document.getElementById("MyIFrameId").src.indexOf("#close_child") > 0) { but i always find that the src is empty

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html