Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div> 
    <button id="google">Google</button>
    <button id="yahoo">Yahoo</button>
    <button id="jcluo">Jcluo</button>
  </div>
  <iframe id="ifr" ></iframe>
</body>
</html>
 
#ifr { border-width: 0;opacity: 0; transition: .5s;};
 
var ifr = document.querySelector('#ifr');
ifr.onload = function () {
  if (this.getAttribute('is-reset') == '1') {
    this.style.opacity = 0;
    this.style.display = 'block';
    this.contentDocument.write("Can't not load Web");
    var url = this.getAttribute('src-url');
    this.setAttribute('src', url);
    this.setAttribute('is-reset',0);
  } else {
    this.style.opacity = '1';  
  }
  
};
function changeUrl(url) {
  ifr.style.display = 'none';
  ifr.setAttribute('is-reset',1);
  ifr.setAttribute('src', 'about:blank');
  
  ifr.setAttribute('src-url', url);
  
}
document.querySelector('#google').onclick = function () {
  changeUrl('http://www.google.com');
}
document.querySelector('#yahoo').onclick = function () {
  changeUrl('http://www.yahoo.com');
}
document.querySelector('#jcluo').onclick = function () {
  changeUrl('http://blog.jcluo.net');
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers