3

I am trying to open a page in new window. I have written the following code

  navigateToURL() {
    window.open("https://www.google.com", "_blank");
  }

But it opens in a new tab whereas I need to open in a new window. Can anyone help me please.

Thanks in advance.

Emdad
  • 822
  • 7
  • 14

2 Answers2

2

Try with the following-

navigateToURL() {
    window.open('http://www.google.com', '_blank', 'toolbar=0,location=0,menubar=0');
}
1

Did you mean something like this?

<body>
<button 
     onclick="Navigate2URL()">Open 
      Google</button>

   <script>
   function Navigate2URL(){

 window.open("https://www.google.com","yourName","height=200,width=200");
    }
  </script>
   </body>
Subha Jeet Sikdar
  • 446
  • 1
  • 4
  • 15