Cross-frame - Works in FF, Fails in IE

Discussion in 'Javascript' started by ashore, Aug 4, 2007.

  1. ashore

    ashore Guest

    The JS is
    parent.top.document.getElementById('level').innerHTML="whatever";

    IE complains "... is null or not an object". Works fine in Firefox.
    Any insights will be appreciated.

    -AS
     
    ashore, Aug 4, 2007
    #1
    1. Advertising

  2. ashore

    ashore Guest

    I shudda mentioned the frame structure. It's:

    <FRAME SRC="top.php" NAME="top" SCROLLING="no">
    <FRAME SRC="main.php" NAME="main">
    -AS
     
    ashore, Aug 4, 2007
    #2
    1. Advertising

  3. ashore wrote:
    > parent.top.document.getElementById('level').innerHTML="whatever";


    parent.top contains redundancy.

    > IE complains "... is null or not an object".


    You are mixing a DOM standard (W3C DOM Level 2) and a proprietary
    implementation (innerHTML) which is known to be error-prone if untested.
    Depending on the IE version, document.getElementById() may not even be
    supported.

    Furthermore, if this is to be cross-frame, the reference to the target
    frame is missing:

    ... window.top.frames["otherframe"].document ...

    > Works fine in Firefox.


    That is highly unlikely. Firefox logs errors in the error console,
    probably you will find the error message there.


    HTH

    PointedEars
    --
    var bugRiddenCrashPronePieceOfJunk = (
    navigator.userAgent.indexOf('MSIE 5') != -1
    && navigator.userAgent.indexOf('Mac') != -1
    ) // Plone, register_function.js:16
     
    Thomas 'PointedEars' Lahn, Aug 4, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gene Ariani

    WebMenu Cross frame

    Gene Ariani, Jan 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    509
    Steve C. Orr [MVP, MCSD]
    Jan 5, 2004
  2. Darius
    Replies:
    1
    Views:
    423
    Bruce Barker
    May 25, 2005
  3. WT

    cross frame scripting

    WT, May 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,589
    bruce barker \(sqlwork.com\)
    May 4, 2006
  4. HL

    cross frame security

    HL, Apr 22, 2004, in forum: ASP General
    Replies:
    1
    Views:
    106
    Evertjan.
    Apr 22, 2004
  5. Colin McKinnon

    cross-frame submit works, but not reset

    Colin McKinnon, Jul 6, 2004, in forum: Javascript
    Replies:
    2
    Views:
    112
    Richard Cornford
    Jul 6, 2004
Loading...

Share This Page