471,086 Members | 1,199 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,086 software developers and data experts.

iframe and netscape question

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="#CC 6633";

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
Jul 20 '05 #1
1 2250
Dom wrote:

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="#CC 6633";

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.imag es['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

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by splish | last post: by
3 posts views Thread by John Chen | last post: by
4 posts views Thread by Marina Ferguson | last post: by
13 posts views Thread by ukrbend | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.