JavaScript code in Corvid

Hey folks.

I am working on an puzzle game. The visitor has to solve the puzzle in a limited time, if not
he will be redirected to another site.
Now this here is the javascript code:

               <h3> 

Redirecting to duckdev.com after 10 seconds

The problem here is obviously it is opening the link in the HTML - Box.
Now is it possible to use the JS-Code in Corvid, so that the whole website redirects you?

Here’s a Countdown example . At the end of the countdown, instead of displaying an image, you can redirect using wix-location.to() . So, this can all be done with Corvid.

Yisrael, thx for the fast reply. I am an beginner in Javascript, so I dont get how I am
going to change the Javascript code to Corvid.

So: windows.location —> wixLocation.to(“http://wix.com”);

The countdown timer from your example isnt always starting from an x-time (for example every time the visitor revisit site starting from 10s).

How could I convert this here into corvid:

// Total seconds to wait var seconds = 10; function countdown() { seconds = seconds - 1; if (seconds < 0) { // Chnage your redirection link here window.location = " [https://duckdev.com](https://duckdev.com/) "; } else { // Update remaining seconds document.getElementById("countdown").innerHTML = seconds; // Count down using javascript window.setTimeout("countdown()", 1000); } }

No need to convert your code into Corvid - I already provided a full example in Corvid.

The example is just that - an example . You can change it to start from whatever time you want. You will want to use the current time and add 10 seconds. Then count down from there and do the redirection.

See this simple Redirect Delay Example .

Thx so much Yisrael. Was working yesterday the whole day on this. Didnt work.
Tried also with backend etc… In the end I gave up.
Coding is not for me xD
But thanks so much. Really appreciate it

@legendkaybe What didn’t work? How can I help?

Wix can’t really supply full code solutions, but I’d be glad to take a look and see how I can help. Please post the editor URL of your site. Only authorized Wix personnel can get access to your site in the editor. Please include the name of the page involved.