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
精彩评论