JavaScript: blur event on window
-
jtosic last edited by
I've implemented:
window.addEventListener("blur", blurBodyHandler, false);
in my JavaScript and when an element in IFrame takes focus my event handler is triggered. In WebKit browsers. Not so in Opera browser on my Smart TV. I've tried:
window.onblur = function(){}
to no avail. I've tried attaching "focus" event listener to IFrame but had no luck with that either.
However, adding event listeners on "DOMContentLoaded" and "keydown" works just fine.