Coding Exit Now/Escape this Site Feature for Non-profit

I am creating a website for a non-profit. One of the issues they deal with is domestic violence. So they want to have an exit now/escape feature on the site. When clicked it would essentially redirect them to a “safe” site, like the weather channel and change their current window to google. I have tried researching and have attempted doing it on my own but what I enter in the velo developer section does not work. This is not my area of expertise so I have no clue what I am doing wrong and how to fix it.

This is one of the sites I found while researching, and I attempted to use the code it mentioned but it did not work.

This is a similar site with the feature active for reference of what I am trying to do.

That shouldn’t be a big problem…

Your wished function → is just a simple → REDIRECTION to another page/site?

<buttononclick="window.location = '';">Go</button>

…then you will need this one —> to - Velo API Reference -

But the proble in Wix-environment will be, that you are not able to control keyboard on the whole page/site.

Instead you only get KEYBOARD-CONTROL on single elements! I know → BAD (but perhaps one day, we will get this feature! BTW: Anybody already putted this onto the WISHLIST → it’s CHRISTMAS soon!) !!!

So i am not sure, if your wished function is doable → pehaps using a custom element?
But an element is an element and not the page itself!

A missed function on the wix-plattform!

I think it is more than a redirection function, but I am not sure? So they do want the button to redirect them to another site (weather channel) in a new tab, which I did not have an issue doing. The issue for me comes with the second part. They also wanted the former current tab to be changed to google.
So “site 1” > click special exit now button > redirected to “site 2 -weather channel” new tab > old tab, no longer “site 1” now “site 3 -google” I hope I explained it right.


@russian-dima It took me to how to link a site to the button, but I am not understanding how that is a able to change the current tab as well? I do not know much in this area so I struggle understand. Would you be able to give me any example?

This is all you can do…

See the Panic Button (brewmaster blog post) example which was developed as the result of another post on this same subject.

1 Like

Damn good Yisrael! Good-Job.
I have to learn → Custom-Elements!:sweat_smile:

Would this also be possible to generate with an html-component?

@russian-dima Sorry, but no. I tried everything, but the HtmlComponent is limited by design (technical and security issues). The Custom Component is the only way - at least that I know of.

1 Like

@yisrael-wix Ok, thanks for info!