242
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

2024-04-02 13-23-43
Gonçalo Ferraria
Champion
Solution

Hi Yifan,

Try the following code:


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


Thank you.

2022-06-17 09-22-26
Huarlem Lima

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

UserImage.jpg
nikkoli castilan

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

2026-01-19 17-09-56
Carlos Lessa
 
MVP

Hi Yifan,

Here is a sample.

Check the code bellow:

Check the oml with the sample.

Hope I could help you.

Cheers,

Carlos Lessa

2024-04-02 13-23-43
Gonçalo Ferraria
Champion
Solution

Hi Yifan,

Try the following code:


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


Thank you.

UserImage.jpg
Yifan Wang

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.