iframe and netscape question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dom

    #1

    iframe and netscape question

    Hi,

    Can anyone help me with this teaser ?

    I have an iframe with id and name set to 'iframe',
    in which I load a frameset of two frames (lets call them TopFrame and BottomFrame).

    Inside frame BottomFrame I have an image object which I manipulate
    from TopFrame and use this to do so :

    top.iframe.Bott omFrame.img1.st yle.borderColor ="#CC6633";

    Now this works no problemo in Internet Explorer.

    However, in Netscape 6.2.1 I get this error in the javascript console :

    Error: top.iframe.Bott omFrame.img1 has no properties

    I tried a number of different ways of getting to img1 in netscape to no avail.

    Can anyone out there suggest some things to try, better yet correct my mistake ?

    Thank you very much if so.

    -Dominic
  • Dom Leonard

    #2
    Re: iframe and netscape question

    Dom wrote:
    [color=blue]
    >
    > I have an iframe with id and name set to 'iframe',
    > in which I load a frameset of two frames (lets call them TopFrame and BottomFrame).
    >
    > Inside frame BottomFrame I have an image object which I manipulate
    > from TopFrame and use this to do so :
    >
    > top.iframe.Bott omFrame.img1.st yle.borderColor ="#CC6633";
    >
    > Now this works no problemo in Internet Explorer.
    >
    > However, in Netscape 6.2.1 I get this error in the javascript console :
    >
    > Error: top.iframe.Bott omFrame.img1 has no properties
    >[/color]

    Netscape uses collections for frames and images which are also
    implemented in IE.

    top refers to the topmost document window,
    parent refers to the immediate parent document window,
    window.frames is a collection/array of frames within a window,
    document.images is a collection/array of document images,

    So would try either:

    parent.frames.B ottomFrame.docu ment.images['img1']

    or the long way:

    top.frames.ifra me.frames.Botto mFrame.document .images['img1]

    (Untested for this post. If an image with id value 'img1' doesn't work,
    try assigning it a name attribute of 'img1')


    HTH,

    Dom Leonard

    Comment

    Working...