Redirect after settimeout when page ready

Hi there,

Having trouble adding some script to page code for a landing page to redirect to the home page after a set time. Weighing up nesting an iframe for full screen video however I think this would impact page ready and I want timer (on settimeout) to start when video starts so will just add a full screen video to page.

Now my current code from searching far and wide isn’t working. Nothing happens apart from video plays out and no redirecting. Can someone help point me in the right direction please? I can’t find any other threads with people that have the same issue.

Thanks in advance.

Here is code:

$w . onReady ( function () {
// Write your JavaScript here

$w . setTimeout ( function (){
window . location . replace = ‘https://cameron8895.editorx.io/holmac/home’ ;
}, 8000 );

// To select an element by ID use: $w('#elementID') 

// Click 'Preview' to run your code 

});


Wix does not support access to the DOM (window, document, etc.). You can use the wix-location.to() API to perform redirection.

Another option is to use a Custom Element which is a reusable web component element that you define in a JavaScript file that is either hosted by Wix or hosted on a server that is external to Wix. The custom element is defined using the standard ECMAScript 2015 class syntax. See this simple Link example to get started.

@yisrael-wix Appreciate it!!!