PDA

View Full Version : Rewriting an iframe from another frame


junkmail
05-04-2003, 08:26 AM
Hey,
I am writing a little webpage using main webpage and an iframe inside the main page.
What I am trying to do is that when the user moves the mouse to a picture or link the iframe would write more description about it. The onmouseover function will write description in the Iframe
I am able to do that but the problem is that when the user moves the mouse to another link the iframe doesnot deletes the previous description, insted it writes after the previous description.
Is there any way to delete the previous writing?
I have tried to load the iframe's location again but the script stops after window.iframeName.location="location";
when i move the mouse to the link it will load the new page but would not goto the next line of code for description until i move the mouse to the same link again.
Dont know why???:rolleyes:
Any help would be very appretiateable
Thanks...

Mr J
05-04-2003, 09:08 PM
Please give the following a try

Page2.htm is loaded into the iframe

In the main page PAGE1.htm

<HTML>
<HEAD>
<TITLE>Document Title</TITLE>
</HEAD>
<BODY>
<P><a href="#null" onmouseover="document.myframe.display.innerText='answer 1'">Question 1</a>
<P><a href="#null" onmouseover="document.myframe.display.innerText='answer 2'">Question 2</a>
<P><iframe name="myframe" src="page2.htm" width=500 height=200></iframe>
</BODY>
</HTML>



In Page2.htm


<HTML>
<HEAD>
<TITLE>Document Title</TITLE>
</HEAD>
<BODY>
<div id="display"></div>
</BODY>
</HTML>

junkmail
05-05-2003, 08:11 AM
:) Thank you I really appreate your help ...
Thanks alot...