Firefox errors not present in IE

M

Mark

Hi

I've just (for the first time - I'm a bit new to this) looked at a page in
Firefox that works fine in IE6.

I am getting multiple errors which I believe to be caused by incompatible
referencing of objects in other frames (the page consists of three frames,
one as a header menu and one as a more context sensitive side menu).

The error I'm getting is along the lines

parent.banner.menuTitle has no properties

"menuTitle" is the "id" of a table cell, and "banner" the frame in the
parent document..

The offending code follows the format:

parent.banner.MenuTitle.innerHTML="<font
size='2'>"+menuItems["itemText"]+"</font>";

Anyone know what I'm doing wrong?

Thanks very much

Mark
 
M

Mark

Thanks dn, brilliant. Will take a look later tonight.

Mark



dn said:
Mark said:
Hi

I've just (for the first time - I'm a bit new to this) looked at a page
in Firefox that works fine in IE6.

I am getting multiple errors which I believe to be caused by incompatible
referencing of objects in other frames (the page consists of three
frames, one as a header menu and one as a more context sensitive side
menu).

The error I'm getting is along the lines

parent.banner.menuTitle has no properties

"menuTitle" is the "id" of a table cell, and "banner" the frame in the
parent document..

The offending code follows the format:

parent.banner.MenuTitle.innerHTML="<font
size='2'>"+menuItems["itemText"]+"</font>";

Anyone know what I'm doing wrong?

Thanks very much

Mark


In order to remain compatible with both IE and FFox, you should be using
the document.getElementByID() function to obtain an object reference when
using ID's.

IE does what they call "pollute the global address space" which in essence
means that they stuff everything into one big pile. It's "purpose" might
have been to give users easier access to objects throughout IE, but it
really only has served to distance IE from the rest of the pack and pretty
much ensure that code that was written to IE specs won't run anywhere
else.


heres a quick 3 file sample on how it can be done to make it work in FFox
and IE ...

FRAMES.HTML ----------------------------------------------------------
<FRAMESET COLS="200, *">
<frame name="banner" src="banner.html">
<frame name="Body" src="body.html">
</frameset>

BODY.HTML-------------------------------------------------------------
<html>
<head>
<script>
function setBanner() {

parent.frames['banner'].document.getElementById('MenuTitle').innerHTML =
'Clicked' // watch for wrap!
return false
}
</script>
</head>
<body>
<a href="javascript:setBanner()">Click me!</a>
</body>
</html>

BANNER.HTML-------------------------------------------------------------
<html>
<head>
</head>
<body>
<div id="MenuTitle">Content</div>
</body>
</html>

This example is quick, not all together valid HTML but serves the purpose
of showing you what needs to be done for XBrowser coding...
 

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

Forum statistics

Threads
474,156
Messages
2,570,878
Members
47,406
Latest member
ElizabetMo

Latest Threads

Top