Hey.
The problematic situation is this:
I have a button that is connected to a link, to open in a new window, via setting the .link and .target properties of the button.
At the same time, I would like to place some code on the onClick event of that button.
It seems like only one of the options run - if I bind it to the onClick event, the link doesn’t work.
So how can I run code AND open the link in a new window at the same time?
Code:
Inside on onReady for the page:
$w ( ‘#buttonJoinSession’ ). onClick (( event ) => joinSessionClick () );
Inside another function:
$w ( ‘#buttonJoinSession’ ). target = “_blank” ;
$w ( ‘#buttonJoinSession’ ). link = space . link ;
The above link is NOT being opened upon click after setting the onClick event as above.
function joinSessionClick () {
wixWindow . openLightbox ( “Translated Session”);
}
THANKS