开发者

Returning a value from an iFrame in a popup to its parent window

开发者 https://www.devze.com 2023-01-10 21:06 出处:网络
Okay, ridiculously simple question, but it is doing my head in so any help would be appreciated! I need to return a value to a form field, the value is returned in an iframe that is in a popup window

Okay, ridiculously simple question, but it is doing my head in so any help would be appreciated!

I need to return a value to a form field, the value is returned in an iframe that is in a popup window.

So, I was thinking something along the lines of

window.top.parent.form.field.value = 'new value'

But that just gives me an error, any ideas would be really helpful! (开发者_StackOverflownot the greatest person in the world with javascript me) Cheers


Ha, and a few minutes after I posted that, I worked it out! Sorry guys! For reference here is the answer:

self.parent.opener.document.form.field.value = 'new value'
0

精彩评论

暂无评论...
验证码 换一张
取 消