-2

I'm trying to Open the given URL in New window, not in new TAB.

people are suggesting to use window open

function myFunction() { window.open("http://www.google.com"); }

but it's opening the url in same browser in new Tab. but i need to open it in same browser and new window

like below image

enter image description here

Can Any one help me,

Thanks in advance

Satti
  • 559
  • 2
  • 8
  • 26
  • 1
    Possible duplicate of [JavaScript open in a new window, not tab](http://stackoverflow.com/questions/726761/javascript-open-in-a-new-window-not-tab) – Charlie Jun 08 '16 at 11:09

3 Answers3

2

You can use this coding to open the url in new browser window.Working perfectly:

<script>
function pop_up(url){
window.open(url,'win2','status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=1076,height=768,directories=no,location=no') 
}
</script>

 <a href="http://www.google.com" onclick="pop_up(this);">OPEN</a>
aarju mishra
  • 710
  • 3
  • 10
1

Call it with a specific height and width.

window.open(url, windowName, "height=200,width=200");
Charlie
  • 22,886
  • 11
  • 59
  • 90
1
window.open('http://www.google.com','newwin', 'width=' + window.screen.availWidth + ',height=' + window.screen.availHeight + ',screenX=0,screenY=0,top=0,left=0left=0,top=0,scrollbars,resizable,replace=true');

The above code will get the screen height and width according to the screen resolution

Vinoth Narayan
  • 275
  • 2
  • 15