Hi,
It may be an old problem but I have similar issues with target_blank function.
I have a list of items in the list page that have some images which are linked to certain item pages where more information can be found about these items. When I click on an item in the list it does not open the relevant/current item page but the one which has been clicked on previously.
For example:
I have images of various fruits in the list page. Let's say, apples, bananas, oranges, grapes, etc.
When I click on the 'apples' image in the list linked to the apples item page, it does open in a new tab which is great, but first time I always have to click on it twice.
Then I click on the 'bananas' image in the list linked to the bananas item page, now I have to click once, but it opens the apples item page again instead of the bananas item page in a new tab.
Then I click on the 'oranges' image in the list linked to the oranges item page, and now the bananas item page opens in a new tab.
Then I click on the 'grapes' images in the list and the oranges item page comes up in a new tab.
And so on...
So it always opens the item page previously click on in the list, except the first one when I have to click twice.
Can anybody explain this strange phenomenon? And does anybody know the solution to my problem? Maybe the memory/cache needs to be refreshed every time? If so, how?
Here is my code:
export function overimage_click(event) {
console.log(event.context.itemId);
if (event.context.itemId === "bdd934b6-15bc-4621-9539-69aae74aa4de") {
$w("#frimage").link = "https://apples.wixsite.com/...";
}
else if (event.context.itemId === "934d4093-73a1-429b-8892-3b714c5a36b6") {
$w("#frimage").link = "https://bananas.wixsite.com/...";
}
else if (event.context.itemId === "ca646ded-1095-4352-85fb-5af3f28beaca") {
$w("#frimage").link = "https://oranges.wixsite.com/...";
}
else if (event.context.itemId === "573dd552-0d51-42b0-97a3-b457c21854a1") {
$w("#frimage").link = "https://grapes.wixsite.com/...";
}
$w("#frimage").target = "_blank";
}
Thank you any suggestion or help!
GyO