I have a button that should be a link that refers to outside webpage. I have read the documentation and carry out every part there and already it is working perfectly in case target is blank it works fine but in case of target self nothing happened it doesn't work. this is my code
despite it takes the correct link in case i use debug but nothing happened the page doen't move to the new one
export function button5_click(event, $w) {
let inputValue = $w("#input1").value;
if (inputValue.length > 0 ) {
let myValue = $w("#input1").value;
$w("#button5").link = "https://xxxxx.com?suburb="+myValue ; $w("#button5").target = "_self";
console.log("nice");
} else{
$w("#input1").focus();
}
}
thanks all I have solved it and now works fine using this link
https://www.wix.com/code/reference/wix-location.html
Did you get it figured out? It would be great to know what caused this.
Check out https://www.wix.com/code/reference/wix-location.html#to as an alternative way to initiate navigation
it is already work in case of $w("#button5").target = "_blank"; but i need it to work in case of self not blank
What does it do? Try changing the target to $w("#button5").target = "_blank"; and seeing that works. Then we can circle back around to fix the first issue.