I have an iframe that I was formally creating using a url with some vars that I was passing in as a GET. Is it possible to set the source page and pass in the variables as a POST or something? Or really, if it's possible to somehow get at the variables stored in the parent I'd be fine with that as well.
Use window.parent
from within the iframe.
In the parent window:
window.passingObj = { "key" : "value" };
In the iframe:
alert(window.parent.passingObj["key"]); // value
Two helpful posts:
iframe accessing parent DOM? (iframe to parent)
Invoking JavaScript code in an iframe from the parent page (parent to iframe)
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