Is it possible to open a links in a new window in javascript? -


i want open google , youtube in 1 click. tricky part here is, want open in new window. achieved on tab. client don't want open in tab. need change on new window.

here's i've tried far.

<a href="#" id="linktrigger">open links</a>  var trigger = document.getelementbyid('linktrigger'),     link = ['www.google.com', 'www.youtube.com'];  trigger.onclick = function {     [].foreach.call(link, function(e){         if(e == 'www.google.com')             window.open(e, 'newwindow', 'height: 100px, width: 100px');         else              window.open(e);     }); } 

i read window.open(/* link */, _blank) should open in new window, however, me. it's opening in new tab. i'm using google chrome 49.

the script can open google expected.

i searched possible solutions there's no same problem me.

any appreciated. thanks!

there full topic how , problems opening urls in new tabs are.

here link: open url in new tab (and not new window) using javascript

hope helps, regards


Comments