Window location problem

I am trying to define a clickable image to take the current page url and open the very same page in a different domain.
For instance, when I am on that page:
a click on that image will automatically send the user to:

I am trying to do it like this:

$w.onReady(function () {
    $w("#image10").onClick( (event, $w) => {
  window.location.href.replace(window.location.origin, window.location.protocol + "//");  // "#image10"
} );


But it doesn’t work.
Please help :slight_smile:
Thank you!

1 Like

Try using wix-location api instead, as it is the intended way for WixCode app to interact with browser’s location api.

1 Like