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>
<a href="https://www.google.com" class="opener">Open google.com</a> | <a href="http://www.yahoo.com" class="opener">Open yahoo.com</a> 
</body>
</html>
 
window.onload = function(){
  var a = document.querySelectorAll('.opener'), w = [], url;
  for(i = 0; i < a.length; i++){
    (function(i){
      a[i].onclick = function(e) {
        if (!w[i] || w[i].closed) {
          url = this.href;
          random = Math.floor((Math.random()*100)+1); 
          w[i] = window.open(url, "_blank", random, "menubar=0,scrollbars=0");
        } else {
          console.log('window ' + url + ' is already opened');
        }
        e.preventDefault();
        w[i].focus();
      };
    })(i);
  }
};
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers