Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    27
    Thanks
    0
    Thanked 2 Times in 2 Posts

    IE8: [object] or [object window] - typecast missing?

    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??

  • #2
    New Coder
    Join Date
    Oct 2011
    Posts
    27
    Thanks
    0
    Thanked 2 Times in 2 Posts
    (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:

    Code:
    <html>
    <head></head>
    <frameset>
    <frame name="mainFrame"/>
    </frameset>
    </html>
    and then, the content of the mainFrame is again build out of several subFrames:

    Code:
    <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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •