Solved

referencing another page

Posted on 2000-05-18
6
170 Views
Last Modified: 2011-10-03
I have a frameset: top,main and banner html pages. I have an image in top.html that changes on certain onmouseover events. Can I reference the image in top.html from an onmouseover event in banner.html?

hope this question makes sense.

ta.
0
Comment
Question by:reido2
  • 3
  • 2
6 Comments
 
LVL 8

Accepted Solution

by:
xabi earned 30 total points
ID: 2820784
Yep:

Example:

parent.page_name.images["imagename"].src = 'foo.gif'

please change "page_name" for the name of the page you give at the frameset and "imagename" for the real image name

xabi
0
 
LVL 8

Expert Comment

by:xabi
ID: 2820788
0
 

Author Comment

by:reido2
ID: 2820920
I cannot get this to work.

my index.html page has one frameset:

<html>
<frameset cols=25%,*>
      <frame name="page1" src="page1.html">
      <frame name="page2" src="page2.html">
</frameset>
</html>

the code on page1.html is:

<html>
<body>
   <img id=me src="button1.gif" onclick=parent.page2.images["fill"].src="button2.gif">
</body>
</html>

the code on page2.html is:
<html>
<body>      
      <img id=fill src="button1.jpg">
</body>
</html>

This should work but it doesn't any ideas?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 22

Expert Comment

by:CJ_S
ID: 2821065
<img id=me src="button1.gif" onclick='parent.page2.images["fill"].src="button2.gif"'>

But this'll only work with IE. For compatibility with NN you should instead use:

<a href="#" onclick='parent.page2.images["fill"].src="button2.gif"; return false;'><img id=me src="button1.gif"></a>

or even

<a href='javascript:parent.page2.images["fill"].src="button2.gif";return false;'><img id=me src="button1.gif"></a>


Good luck,
CJ
0
 
LVL 8

Expert Comment

by:xabi
ID: 2821206
the code on page2.html should be:

<html>
<body>
<img id=fill name="fill" src="button1.jpg">
</body>
</html>

xabi

PS: Note the "NAME" tag
0
 

Author Comment

by:reido2
ID: 2821261
I still could not for the life of me get that to work. I amended the code to read:

onclick=parent.page2.fill.src="button2.jpg"

I have spent too long on this so I will simply use that method.

But thanks anyway.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now