There are times to open links in the current window, sometimes in a new window, sometimes in background. Here is how to do it.

function open2(url, opt){
  if (opt == 0) // current window
    window.location = url;
  else if (opt == 1) // new window
    window.open(url);
  else if (opt == 2) // background window
    {window.open(url); self.focus();}
}

The syntax is a bit confusing, I guess these should be standardized in the future.

Ref link: http://snippets.dzone.com/posts/show/2915