19
Views
5
Comments
Solved
Open link in a new window (NOT TAB)
Application Type
Traditional Web

Hi Everyone,


I have a link on my page, and I want it to open it in a new window (not a new tab) when clicking it. Currently, this link points to a new screen action, and in this new screen action I have a RunJavaScript server action with the following script:

"window.open('"+EncodeJavaScript(URL)+"')"

 However, it still open the link in new tab (on both IE11 and Chrome). Is there any solution to this problem?


Best,

Yifan

Solution

Hi Yifan,

Try the following code:


"window.open('https://www.google.pt', 'newwindow','width:500,height:500'); return false;"


Thank you.

Rank: #68

Hello Yifan,


Only with HTML is not possible, try with this javascript.


<a href="www.google.com"  

    onclick="window.open('http://www.google.com', 

                         'newwindow', 

                         'width=600,height=600'); 

              return false;"


 >Open in new window</a>


https://www.w3schools.com/code/tryit.asp?filename=GKBENBNX8OE6

Rank: #4770

Hello Yifan,

window.open("www.google.com","","toolbar=no,status=no,menubar=no,location=center,scrollbars=no,resizable=no,height=500,width=657");

This will create a new window upon click just replace the google part with your URL

Rank: #187

Hi Yifan,

Here is a sample.

Check the code bellow:

Check the oml with the sample.

Hope I could help you.

Cheers,

Carlos Lessa

Solution

Hi Yifan,

Try the following code:


"window.open('https://www.google.pt', 'newwindow','width:500,height:500'); return false;"


Thank you.

Rank: #6553

Thanks everyone! Turns out that 'width: 500, height:500' is crucial in this.