mplungjan
mplungjan

Reputation: 178285

Cross domain access to iframe using window.name

I implemented a script that monitors the iframe name as I understood was OK from various sources on the net. However it seems I must have gotten something wrong - I get

Error: Permission denied to access property 'name'
Source File: http://plungjan.name/test/testwindowname.html
Line: 16

Please visit http://plungjan.name/test/testwindowname.html

I would prefer just to fix my script and not use jQuery or DOJO or some other framework. Thanks

Upvotes: 2

Views: 9621

Answers (3)

Chris Jacob
Chris Jacob

Reputation: 12276

Take a look at this question:

Resizing an iframe based on content

Has a Cross Domain solution ... but you need to have access to both the servers to implement this solution.

Upvotes: 0

Sean Kinsey
Sean Kinsey

Reputation: 38046

Is it cross-domain communication you need here, or just the name of the window?

If the first one, take a look at easyXDM - it abstracts away all the hassle with XDM across browsers ranging from IE6 to Chrome10.

Upvotes: 1

Valentin Kantor
Valentin Kantor

Reputation: 1844

as I remember you must change iframe location to "about:blank" and after it you can access to its window.name property

Upvotes: 1

Related Questions