Forum Moderators: open

Message Too Old, No Replies

firefox url loading in iframe/div nest problem

         

baudrillard

4:32 pm on May 20, 2005 (gmt 0)



Hi all

Am having issues with the javascript code below in firefox:

<script language="javascript">
function changeurl(whichpage){
document.getElementById['testlayer'].document.getElementById['testiframe'].src=whichpage + ".html";
}
</script>

when it references:

<div id=testlayer name="testlayer" width=200 height=200 position=absolute>
<img name="checkimg" id="checkimg" width=30 height=30 src="http://www.thesun.co.uk/picture/0,,2005230215,00.gif">
<iframe id="testiframe" width=150 height=150 name="testiframe" src="a.html"></iframe>
</div>

<br><br><BR><BR><BR><br><br><BR><BR><BR><a href="javascript: changeurl('b');">hello</a>

Basically the url of the nested Iframe should change from a.html to b.html but doesn't - probably an easy fix but hopefully someone out there can solve my problem :) Cheers!

orion_rus

4:07 pm on May 21, 2005 (gmt 0)

10+ Year Member



you need to change this:
document.getElementById['testlayer'].document.getElementById['testiframe'].src=whichpage + ".html";
to this:
document.getElementById['testiframe'].src=whichpage + ".html";
or this:
testiframe.src=whichpage + ".html";
good luck to you