estudiofaz / ie7-js

Automatically exported from code.google.com/p/ie7-js
0 stars 0 forks source link

document.activeElement causes JavaScript error when script is used inside iframe #361

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Using page with ie9.js inside an iframe

What is the expected output? What do you see instead?
No JavaScript errors, and script is successful.  I see JavaScript error 
"Unspecified Error", and script does not complete.

Code that produces error:
if (element == document.activeElement) {
      Focus.register(instance)
    }

What version of the product are you using? On what operating system?
ie9.js, on IE7 and IE8 on Windows XP.

Please provide any additional information below.
Fixed (may not be best solution) by adding code:

if(typeof document.activeElement != 'unknown'){
    if (element == document.activeElement) {
      Focus.register(instance)
    }
}

Original issue reported on code.google.com by jeff.bh...@gmail.com on 19 Mar 2012 at 6:15