Skip to content Skip to sidebar Skip to footer

Full Featured Iframe W/ Forward/back Buttons, Url Loader, Etc

Thanks for viewing my question. So, I have a question with iframes. I want an iframe that is almost like an actual browser. I need to make it have atleast a forward button, a back

Solution 1:

<html>
<head>
  <title> iFrame </title>
  <script language="javascript"> 
   function LoadPage(){ 
     var objFrame=document.getElementById("myIframe"); 
     objFrame.src=document.getElementById("URL").value;
    }
  </script>
</head>
<body>
<div style="Clear:both;"> 
 <input type="text" value="http://amazon.co.uk" class="frmUrlVal" ID="URL">
 <input type="submit" class="frmSubmit" value="Go" onclick="LoadPage()">
 <input type="button" VALUE="&lt; &lt; &nbsp; Back &nbsp;"  onClick="myIframe.history.back()"> 
 <input type="button" VALUE="Forward &nbsp; &gt; &gt;"  onClick="myIframe.history.forward()"> 
</div>
<iframe align="center" width="100%" height="90%" src="http://amazon.co.uk" frameborder=yes scrolling="yes" name="myIframe" id="myIframe"> </iframe>
</body>
</html>

Post a Comment for "Full Featured Iframe W/ Forward/back Buttons, Url Loader, Etc"