开发者

How can I launch a javascript from an <iframe>?

There is an iframe on the page.

开发者_StackOverflow中文版

Can the parent document (iframe parent) be accessed from this iframe?

What I want to do: when the user presses a button inside iframe something happens on the main page

Thanks!


you tried parent.?


In my experience, it works, as long as its the same domain.


If I understand correctly, this behavior is not allowed. An iframe would contain contents from some other domain, and if that domain could issue code to affect the elements of the first domain, security ruin would ensue. Read this info about the same-origin policy: http://en.wikipedia.org/wiki/Same_origin_policy

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜