jalexiscv / base2

Automatically exported from code.google.com/p/base2
0 stars 0 forks source link

'Unspecified error' when loading a page via iframe in IE8. #132

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create page1.html, with a single <iframe src="page2.html"><iframe>
2. Create page2.html with:
<html><head>
 <script type="text/javascript" src="/path_to_base2/v1.0/src/base2.js"></script>
 <script type="text/javascript" src="/path_to_base2/v1.0/src/base2-dom.js"></script>    
</head>
<body>
  <img src="http://www.google.com/intl/en_ALL/images/srpr/logo1w.png" /> 
</body>
</html> 
3. Open page1.html in Internet Explorer 8 or 7. 

What is the expected output? What do you see instead?
IE complains of an 'unspecified error'.

What version of the product are you using? On what operating system?
Tested with Base2 v1.0, IE 8, Win XP.

Please provide any additional information below.

Error is triggered by the access to the activeElement property in base2-dom.js 
line 2027:

 onDOMContentLoaded: function(event) {
     forEach (event.target.forms, this._registerForm, this);
     this.setFocus(this.document.activeElement);
 },

According to this:
http://msdn.microsoft.com/en-us/library/ms533065(v=VS.85).aspx
the activeElement property is not defined until a document is loaded (onload 
event). 

Removing the img tag, or not loading the page via iframe does not trigger the 
error.

Original issue reported on code.google.com by cedric.s...@gmail.com on 7 Jul 2010 at 6:39