By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,141 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

iframe and netscape question

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.