Tom
Tom

Reputation: 3

iFrame Access Problem

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

Upvotes: 0

Views: 137

Answers (2)

thelost
thelost

Reputation: 6694

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

Upvotes: 1

EAMann
EAMann

Reputation: 4146

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.

Upvotes: 1

Related Questions