iframe and netscape question

D

Dom

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.BottomFrame.img1.style.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.BottomFrame.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
 
D

Dom Leonard

Dom said:
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.BottomFrame.img1.style.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.BottomFrame.img1 has no properties

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.BottomFrame.document.images['img1']

or the long way:

top.frames.iframe.frames.BottomFrame.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
 
D

Dom

Dom Leonard said:
Dom said:
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.BottomFrame.img1.style.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.BottomFrame.img1 has no properties

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.BottomFrame.document.images['img1']

or the long way:

top.frames.iframe.frames.BottomFrame.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

Dom,
thanks very much - this worked nicely.
-Dominic
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,098
Messages
2,570,625
Members
47,236
Latest member
EverestNero

Latest Threads

Top