Reputation: 3938
I have an iframe in my web-page. So when Esc is pressed inside the iframe I need to set focus the top frame of document. The iframe is from an different domain.
Here Frame-B URL will be some abc.com and frame-A will be from xyz.com
So when an event is fired in Frame-B I need to focus Frame-A.
I can bind any number of events in Frame-A and Frame-B.
I have found a old way like this "An iframe in an iframe in an iframe". which am not interested in.
Any Idea how this can be done?
Upvotes: 0
Views: 1939
Reputation: 24370
If you have some control over the outer frame (let's say it's your site, but still a different one than B), then there's a number of solutions to your problem. If you don't have any control over the outer frame, (because it is google.com for example) then there's nothing you can do. The browsers are designed to prevent it. See Jonas answer.
So what about if you can control the outer page? Any of the following would work:
Upvotes: 4