Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

howard

macrumors 68020
Original poster
Nov 18, 2002
2,017
4
so here's my question..

I have an iframe in the middle of a page and I would like to have different links around it that change the content of the iframe. Is this possible? Possible without making a separate making a separate html document for each iframe?
 
You might be able to change it using JavaScript, but I haven't actually tried it.

HTML:
<iframe id="f" src="http://url"><iframe>

Code:
function changeIframe(url)
{
  var f = document.getElementById("f");
  f.src = url;
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.