开发者

iFrame Access Problem

开发者 https://www.devze.com 2022-12-30 09:09 出处:网络
I have data in a iframe. When a user performs an action - I want this want this data to开发者_运维百科 be collated and sent \"inside\" another iframe inside this iframe.

I have data in a iframe. When a user performs an action - I want this want this data to开发者_运维百科 be collated and sent "inside" another iframe inside this iframe.

I have having a bit trouble achieving this and was wondering whether its possible and if it is, how I can do it ?

Thx


A quick solution would be to pass instructions (actions, variables, etc) as query variables in a url. You can use your outside script to change the iFrame reference and a script inside the iFrame can read back those variables and do something with them.

Basically starting with http://someurl.com/page.html in your iFrame and dynamically changing it to http://someurl.com/page.html?action=do-something&with=this. Since we're talking Javascript, you can force the iFrame to refresh asynchronously, giving the illusion that it's loading new, interactive data.


I has this problem a while ago and did not find any solution. As I remember, you cannot control an inner frame from its owner due to some security concerns.

Later Edit: you might be able to synchronize them by using an intermediate component (such a database) - this is how I ended with my issue

0

精彩评论

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

关注公众号