I have an editor with an SWF multi-image uploader. Since not everyone will need to upload pictures in their article, i need to dynamically load this image uploader when necessary. I have to load it in an iframe because the uploader needs some external scripts to be loaded ahead. And since i need it's callback variable for my editor to use I want to know whether scripts in iframe can interacts with scripts in the main page. Or if i can't do that, what's the alternative way to do this?
If they are on the same domain, yes.
The parent
object is the parent window of the iframe.
If you had a variable a
in the global scope of the parent window, you could manipulate it in the iframe like this:
parent.a = "new value";
Similarly, if a
is a function in the global scope of the parent window, you could call it like this:
parent.a(args);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With