Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › JS event on search results returned › Reply To: JS event on search results returned
February 18, 2026 at 9:49 am
#57007
Keymaster
Hi,
Yes – it is possible through the JS API 🙂
This is what you are looking for:
window.addEventListener("load", () => {
document.querySelectorAll(".asp_main_container").forEach((el) => {
el.addEventListener("asp_results_show", (event) => {
// event.detail carries the arguments
const [id, instance, phrase] = event.detail;
console.log(id, instance, phrase);
});
});
});
I hope this helps!