Rate this script:  I Love it  /   I Hate it

how to open links in current window, new window, background.


Code


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();}
}
 

 

 
how to open links in current window, new window, background. scripts | how to open links in current window, new window, background. snippet | how to open links in current window, new window, background. example | how to open links in current window, new window, background. tutorial | how to open links in current window, new window, background. code