1

Can I open links on click in new browser (not a popup) window?

Things I have tried:

<a href='http://osric.net/' onclick='return !window.open(this.href);'>osric.net web hosting</a>

A function onclick:

var windowObjectReference;
var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes, toolbar=yes";

function openRequestedPopup() {
  windowObjectReference = window.open("http://www.cnn.com/", "CNN_WindowName", strWindowFeatures);
}

but with these it opens in new tab only.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
john
  • 796
  • 1
  • 13
  • 34

2 Answers2

0

This works on IE 11:

<script>
function popupBrowser(url) {
  window.open(url, "WindowName", "config=menubar=no,location=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes,fullscreen=yes");
}
</script>

<a href="javascript:popupBrowser('http://www.cnn.com')">Open a new browser for IE11</a>

It just imitates browser by using windows.open()

JSFiddle demo

Nick Tsai
  • 3,799
  • 33
  • 36
-1

Here it goes

<a href="your_link" target="_blank">Visit</a>

target="_blank" - is the key

Use this for new window

<a href="print.html"  onclick="window.open('print.html', 'newwindow', 'width=300, height=250'); return false;"> Print</a>

Ref: Make a link open a new window (not tab)

kawadhiya21
  • 2,458
  • 21
  • 34
  • 1
    But `target='_blank'` does not control wether the window is opened in a tab or in a new window. – Code4R7 Jun 06 '17 at 09:24