I have an Input field with the id ‘slugInput’ and a button underneath with the id ‘submitButton’. I need people to enter their unique slug into the input field and for a page to open with the URL + slug.
The openURL doesn’t work. What do I replace it with? Is there a different way to solve this problem?
Thanks in advance. (see my code below)
import wixWindow from ‘wix-window’ ;
$w . onReady ( function () {
const input = $w ( ‘#slugInput’ );
const button = $w ( ‘#submitButton’ );
button . onClick ( function () {
const slug = input . value ;
const url = ‘https://mywebsite.com/’ + slug ;
wixWindow . openUrl ( url , ‘_self’ );
});
});