Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Firefox - frameset problem - XXX has no properties 1

Status
Not open for further replies.

adknbvi

Programmer
Apr 17, 2001
25
0
0
US
I have a problem that I've seen addressed multiple times in this forum, but I've tried the previously posted solution and I just can't seem to get it right.

I have a frameset as part of a simple web site for viewing family pictures.

Frames Page code looks like this:
Code:
<FRAMESET cols="30%,70%" border=0>
<FRAME src="Mar07Content.htm" NAME="fraContent">
<FRAME src="Mar07Pictures.htm"  name="fraPictures">

The Content page has text and thumbnail pics. The Pictures page shows the full sized pics.

The Content page has the following code (just showing pieces of it, obviously, to illustrate the thumbnail and the JS behind it):
Code:
<script>
function image_onclick(strImg)
{
	parent.fraPictures.document.divPic.innerHTML=strImg;
}
</script>

<a onclick="image_onclick('<img src=IMG_4540.JPG>')">
    <img border="0" src="TN_IMG_4540.JPG" width="95" height="127"></a>

The Pictures page looks like this (with first picture from thumbnails as default):
Code:
<body>
<div id=divPic><img src=IMG_4499.JPG></div>
</body>

This works beautifully in IE. Clicking on the thumbnails in Firefox results in a message in the Error Console stating parent.fraPictures.document.divPic has no properties.

Any help would be greatly appreciated.
Valerie
 
try putting window in front of parent

window.parent.blah.blahhhhhhhhhhh

[monkey][snake] <.
 
parent.fraPictures.document.divPic.innerHTML=strImg;
[tt]parent.fraPictures.document.[blue]getElementById("divPic")[/blue].innerHTML=strImg;[/tt]
 
tsuji is correct. But instead of putting all that referencing, just put:

Code:
[s]parent.fraPictures.[/s]document.getElementById("divPic")

This is the way I reference things 99% of the time, it's easy, simple and it works.

[monkey][snake] <.
 
It is working on a different frame, ms!
 
Yeah, you're right tsuji. My knowledge on frames is weak. I usually avoid them.


Unstrikeout the strikeout!!

[monkey][snake] <.
 
THANKS SO MUCH!! I added the getElementById() reference and all is well! You guys ROCK!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top