Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Opening a web page in code
Mon, Mar 28 2022 10:03 PMPermanent Link

Paul Coshott

Avatar

Hi All,
Can anyone tell me how I can open an external web page in code? I am writing a web app for a client who needs Facebook, Instagram and Pinterest logos (and 1 of their own images) all to be clickable to open other pages. I'd like these to open in a new tab.

How can I do this?

Cheers,
Paul
Mon, Mar 28 2022 10:57 PMPermanent Link

erickengelke

Paul Coshott wrote:
>Can anyone tell me how I can open an external web page in code? I am writing a web app for a client
>who needs Facebook, Instagram and Pinterest logos (and 1 of their own images) all to be clickable to
>open other pages. I'd like these to open in a new tab.


window.open('https://www.facebook.com','_blank');
EWB Programming Books and Component Library
http://www.erickengelke.com
Tue, Mar 29 2022 9:26 PMPermanent Link

Paul Coshott

Avatar

erickengelke wrote:

>>window.open('https://www.facebook.com','_blank');

Perfect. Thanks Erick.

Cheers,
Paul
Wed, Apr 6 2022 5:59 AMPermanent Link

Paul Coshott

Avatar


>>window.open('https://www.facebook.com','_blank');

I also need to open one web page and rather than open it in a new tab, I need to replace the EWB web app that's running. I tried replacing _blank with _self but that didn't work.

Anyone know how to open a page in the current tab?

Thanks,
Paul
Wed, Apr 6 2022 6:17 AMPermanent Link

Paul Coshott

Avatar

My bad, I had 2 places where the web page is opened. I coded one and tested the other. So using _self does work Smile

Cheers,
Paul


>>window.open('https://www.facebook.com','_blank');

I also need to open one web page and rather than open it in a new tab, I need to replace the EWB web app that's running. I tried replacing _blank with _self but that didn't work.

Anyone know how to open a page in the current tab?

Thanks,
Paul
Wed, Apr 6 2022 11:04 AMPermanent Link

Walter Matte

Tactical Business Corporation




   windows.location.href := 'https://www.facebook.com';

Documentation here...

https://developer.mozilla.org/en-US/docs/Web/API/Location/href

Walter
Image