2 Answers
2

The same-origin policy is probably blocking you from doing this. This can also happen in some browsers if both pages use a file:// uri scheme.

If the iframe and the outer windows will be using the same domain, this problem should go away once your code is on a server. Try serving it from localhost using apache to check, or test it with google chrome with same-origin policy disabled as per this post:

On the other hand, if the iframe needs to be at a different domain, or this needs to work with the file:// uri scheme, you'll need to use some kind of workaround.

One way to pass data into an iframe at another domain is via a fragment identifier in the iframe element's src attribute, which will be visible in the iframe window's 'location' object's 'hash' property; for example: