charlottedee
03-19-2006, 05:06 PM
I'm using an iframe within my webpage and want to have a link that when clicked changes the content of the iframe, however, each time it is clicked it will link to a different page from a javascript array. At the moment I have tried a function which increments the position in the array and should then change the content of the iframe but this doesn't work. I've tried doing this using the dom model rather than linking with target as I couldn't handle the array that way.
function next(){
pos+=1;
item=regionarray[pos];
document.getElementById("info").src="./page.php?item="+item;
}
<IFRAME SRC="./top.html" name="info" WIDTH=450 HEIGHT=100>
If you can see this, your browser doesn't
understand IFRAME. However, we'll still
<A HREF="./top.html">link</A>
you to the file.
</IFRAME>
<p>
<a href='javascript:next()'>Next</a>
Does anyone know why its not working with the DOM stuff or whether there is a better way of doing this?
Thanks
function next(){
pos+=1;
item=regionarray[pos];
document.getElementById("info").src="./page.php?item="+item;
}
<IFRAME SRC="./top.html" name="info" WIDTH=450 HEIGHT=100>
If you can see this, your browser doesn't
understand IFRAME. However, we'll still
<A HREF="./top.html">link</A>
you to the file.
</IFRAME>
<p>
<a href='javascript:next()'>Next</a>
Does anyone know why its not working with the DOM stuff or whether there is a better way of doing this?
Thanks