wixLocation.to - only works on published site?

Hi All,

I’ve a very simple code example below, click a button, it takes you to another webpage.

Doesn’t work in Preview Mode, no error message, it simply just stays on the original page.

Works perfectly on the Published Site, the current page, goes the that in the URL on the wixLocation.to

Any ideas why this is only working on the Published site?

I’ve Googled this for over an hour and most people are having troubles the other way round, i.e. works in preview, fails in published!!

Windows 10, latest version of Chrome, free version of Wix.

Any advice is most appreciated,

Many thanks,

Cheers,

Andy.

CODE SAMPLE ------------------------------------------------------------------------------------------------------------------------

import wixLocation from ‘wix-location’ ;

$w.onReady( function () {

});

export function button1_click(event) {

wixLocation.to( "http://www.mizuno.com" ); 

}

In my opinion Wix Preview only previews wix pages like local pages or a wix site in preview window.

In your case your are setting a redirect to an external website which wix preview don’t recognise as a wix site or a wix page hence it will not show any error or redirection notification.

Many thanks for this, it’s much appreciated, that’s a good call. I’m going to also include a local wix site too and then see if that works in preview. You’ve given me something now, to look into, many thanks again.