Reload iframe to another url : Iframe « HTML « JavaScript DHTML






Reload iframe to another url

   

<html>
<head>
<title>iFrame</title>
</head>
<body>
<script type="text/javascript">
function handleResponse(choice) {
  var pick = frames["MyFrame"];
  pick.document.writeln(choice);
}
</script>
<iframe id="MyFrame"
  name="MyFrame"
  style="width:800px; height:800px; border: 0px"
  src="http://www.java2s.com"></iframe>

<p>
<a href="" onclick="parent.MyFrame.location.replace('1.html');return false">choice 1</a><br />
<a href="" onclick="parent.MyFrame.location.replace('2.html'); return false">choice 2</a><br />
</p>
</body>
</html>

   
    
    
  








Related examples in the same category

1.'contentWindow' Example
2.'allowTransparency' Example
3.Update two iframes
4.IFrame operation