Reputation: 1318
Has someone an idea how I can check if the user works currently in the iframe? E. g. the user clicks into the iframe. I know that I can't get any information about the target but the iframe element it self is embedded into my website, so the question is: is there any way to detect if the user "activates" or "focuses" the iframe element? The "onactivate" and "onfocus" actions doesn't work in Chrome...
Edit: I want the parent window to detect if the user changes to the iframe. The frame is on my domain.
Upvotes: 2
Views: 108
Reputation: 34288
If the content of the inner iframe
are under your control, then you can try:
onclick
and onfocus
events on the <body>
of the internal iframe
window.parent
.However, note that messaging is only supported IE8+.
Upvotes: 1