wixLocation.to() opens in same window - I want to open in a new window

OK, I’m not sure why my post was closed. It has never been answered satisfactorily.

I know you can configure a button to either open a link in the current window or a new window. You can’t do that with wixLocation.to(). Why not? Can this get fixed?

Mike.

1 Like

You can’t use wixLocation.to() with a new window. But you can set the link and target of a button. https://www.wix.com/velo/reference/$w/button/link. This is helpful if you want to dynamically set the target instead of using the normal interface.

But then the user has to push the button to go to the link. If a button can open a current window or new window, why can’t we have a function call to do the same thing?