Click event / destination #194
-
Sorry if I'm missing something super obvious, but if I wanted the selected result to open a page is that built into the script already? I didn't see a way to add URLs to the JSON and didn't see the code in onSelection to open a URL. Maybe it doesn't and it was just expected for someone using this to be able to add that? Thank you ahead of time. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello @jmmpf, Apologies for my late reply. Assuming you have a {
"key": "value",
"url": "https://www.google.com/"
}
onSelection: feedback => {
window.location.href = feedback.selection.value.url;
}
onSelection: feedback => {
window.open(feedback.selection.value.url, "_blank");
} Have a nice day! :) |
Beta Was this translation helpful? Give feedback.
Hello @jmmpf,
Apologies for my late reply.
Assuming you have a
JSON
object that looks like the below.Have a nice day! :)