Specify window "features" to the open call:
window.open(url, windowName, "height=200,width=200");
When you specify a width/height, it will open it in a new window instead of a tab.
See https://developer.mozilla.org/en-US/docs/Web/API/Window.open#Position_and_size_features for all the possible features.
Answer from DNS on Stack OverflowVideos
Specify window "features" to the open call:
window.open(url, windowName, "height=200,width=200");
When you specify a width/height, it will open it in a new window instead of a tab.
See https://developer.mozilla.org/en-US/docs/Web/API/Window.open#Position_and_size_features for all the possible features.
You don't need to use height, just make sure you use _blank, Without it, it opens in a new tab.
For a empty window:
window.open('', '_blank', 'toolbar=0,location=0,menubar=0');
For a specific URL:
window.open('http://www.google.com', '_blank', 'toolbar=0,location=0,menubar=0');
Use window.open():
<a onclick="window.open(document.URL, '_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes');">
Share Page
</a>
This will create a link titled Share Page which opens the current url in a new window with a height of 570 and width of 520.
Just use window.open() function? The third parameter lets you specify window size.
Example
var strWindowFeatures = "location=yes,height=570,width=520,scrollbars=yes,status=yes";
var URL = "https://www.linkedin.com/cws/share?mini=true&url=" + location.href;
var win = window.open(URL, "_blank", strWindowFeatures);
That's because this isn't a full URL:
www.teladocc.com
It's a relative URL. The browser has no way of knowing the difference between www.teladocc.com and, say, index.html.
If you did this:
window.open('index.html')
Then you wouldn't really expect to go to http://index.html, would you?
Use a fully-qualified URL:
window.open('http://www.teladocc.com/pnc')
You can add the http protocol to the url, like this:
&TeledoccLogo = "<a onclick=""javascript:window.open('http://www.teladocc.com/pnc');iAddClickStat('Benefits_Teladocc_Link');return false;"" href='#'>