...

View Full Version : IE8: [object] or [object window] - typecast missing?



moon-safari
03-08-2012, 04:34 PM
Hello together!

I generate html code with jsp. In that jsp there a several framesets and frames. And yes i know, frames are not really up to date but it's an old program and i have to deal with it now. Anyway, in the top frameset i have an onload attribute like onload="load()".

In the function load i want to access the Element.prototype object. But unfortunately typeof Element gives me "undefined". So i looked a little deeper and found that window.toString() gives me "[object]" and not as expected "[object window]" so somehow my window doesn't know that its construcor is Window. window.construcor is "undefined" as well. And i don't have access to the Element object. I really don't know where the error could be. When the page is loaded and i access the same window over the console, then everything is right. But in my function a can't get access to the objects i need.

I also don't know what part of the code could be useful to post here, but maybe someone had a similar problem before? i should say that this problem only occurs in IE8. In IE9 it works perfectly.

Has anyone any idea??

moon-safari
03-09-2012, 11:09 AM
(partially) SOLVED

ok, for everyone who is interested: the problem was in fact frame related.

the structure i'm working with looks something like this: there is a jsp that creates the top page:


<html>
<head></head>
<frameset>
<frame name="mainFrame"/>
</frameset>
</html>

and then, the content of the mainFrame is again build out of several subFrames:


<html>
<head></head>
<frameset>
<frameset>
<frame name="Frame1"/>
<frameset>
<frame name="Frame2"/>
<frame name="Frame3"/>
</frameset>
</frameset>
<frameset>
<frame name="Frame4"/>
<frame name="Frame5"/>
</frameset>
</frameset>
</html>

At first i tried to access the Window object from within the second structure. Here i always got "undefined". But when i put all my javascript that needs to access this object in the very top page, then it works. So somehow the Window object, as well as the Element and the Document object and so on, "get lost" inside the frame content of the top page. And therefor i couldn't access window.constructor or Element.prototype.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum