Document.activeElement in iframe shows unspecified error in IE standards mode

console.log(document.activeElement); 

This code is in an iframe, when you open a page containing this iframe, "SCRIPT16389: Unspecified error" is displayed in IE 8/9 standards mode. No problem opening in quirks mode. I don't know about this, I was looking to see if IE supports document.activeElement, it is listed as> IE4.

+6
source share
3 answers

check the link below if it helps you ..
Link

+8
source

If you have jquery, try the following workaround:

 <script> jQuery(function () { document.documentElement.focus(); }); </script> 
+6
source

try adding a title

 X-Frame-Options: SAMEORIGIN 

work for me without changing javascript code.

0
source

All Articles