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

Is there a way to open an external link in a NEW window in the browser when done with code using wixLocation.to()? I have to open using code because the link is being pulled out of a collection.

Mike.

window.open('https://www.codexworld.com', '_blank');

Hmmm. Where is “window” declared? What do I need to import?

@mikestrauser Oh, just use regular javascript

@kdesimini Well, you’re talking to a newbie. I just started coding in Wix on Monday :slight_smile: Have to say I am pretty pleased as my project is done except that I really want links to open in a new window instead of the same one… Not sure how to do what you say here when I am coding in Wix…

window.open() does not exist in Corvid. Please read the documentation here

Read this for more information on your issue.

@shantanukumar847 I had read that post. Why hasn’t Wix fixed this. You can do it from a Button so why can’t we do it via code?!!!

@mikestrauser LinkableMixin - Velo API Reference - Wix.com

@kdesimini Not sure how that helps as it sets the behavior of an Element. I am pulling an external Link from a database and need to go to it - not because of a button press…

But this does go to my point above. Why can we set an element’s behavior either way but we can’t directly go to a link either way in code???

@mikestrauser Did you find a solution for it? I have the same problem…