DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
How To Open Links In Current Window, New Window, Background.
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();}
}






Comments
Carla Brian replied on Thu, 2012/07/26 - 7:32pm
Snippets Manager replied on Wed, 2010/06/09 - 8:33am