title: Force websites to display in Iframe
body: <p>I used below "crude" code to display a set of websites via an iframe. When one clicks <strong>Next</strong> button the next website in the embedded website list, shows up in an iframe. I also have <strong>Jump</strong>, <strong>Reload</strong> etc.</p>
  
  <p>But my problem is that, few websites display outside the iframe and replace the current window, while one site displays well in iframe but sends a page outside the iframe when a link on it is clicked. </p>
  
  <p>I want to force every site and the links on them to display in the iframe. Except popups. Thanks for any help.</p>
  
  <pre><code>&lt;script&gt;
  var s=[
  "gin.htm",
  "http://samplewebsite1.com",
  "http://samplewebsite2.com",
  "http://samplewebsite3.com",
  ];
  var adr,i,x=0,c=s.length;
  function address() {
  adr=prompt('Enter your bitcoin address:');
  s=s.map(function(x){
  return x.indexOf("a=") != -1 ? x + adr : x; 
  });
  }
  function next(){
  x+=1;
  if (x&gt;c-1)
    {
    x=0;
    }
  changeSrc();
  }
  function prev(){
  x-=1;
  if (x&lt;=0)
    {
    x=c-1;
    }
  changeSrc();
  }
  function jumpTo() {
  i=prompt("Enter a number to skip to that faucet.");
  x=0;
  while (i!=x) {
    if (x&gt;c-2) {
    break;
    }
   x+=1;
  }
  changeSrc();
  }
  function newTab() {
  var win=window.open(document.getElementById("fm").src, '_blank');
  win.focus();
  }
  function changeSrc() {
  document.getElementById("fm").src=s[x];
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>This is the Iframe;</p>
  
  <pre><code>&lt;iframe name="iFrame" id="fm" left="0" top="56" width="100%" style="height:    99vh;" frameborder="0" position="absolute" src="./gin.htm"&gt;
  </code></pre>
  
  <p></p>