Forum Moderators: open
```````````````````````````
here it is:
<script>
function loadIframe(iframeName, url) {
if ( window.frames[iframeName] ) {
window.frames[iframeName].location = url;
return false;
}
else return true;
}
</script>
<a href="page1.html" onmouseover="return loadIframe('iframe', this.href)">Mouse over this link!</a>
<iframe src="iframecontents.html" name="iframe"></iframe>
```````````````````````````
Mousing over the link will swap the contents of the iframe (iframecontents.html) with page1.html. This is working just fine.
What I want to add is make the link go to another page when clicked, ie page2.html (in the same window).
Maybe this is simple question, but I am really not a programmer at all. The source of this code I found while searching around. I just adapted it to my site. So if anyone could show me how to add this, I would really appreciate it.
Thanks.
I have two more questions concerning this, hoping you could help.
1) For the page that is inside the iframe, is it possible to load a link into the main window, rather than just inside the frame?
2) and also for the code:
loadIframe('navigation', 'navigation/page.html')
is it possible to link to a file farther up in the directory? For example I would want it to link to
loadIframe('navigation', '../../navigation/page.html')
but that doesn't work.
Thanks