Click fired multiple times

I have main page (Units) with virtual list dynamically created using app.request. When user select Unit I open another page with links, also dynamically created. Click on link event fired once. When click back button and select another unit, click event on next page fired twice and so on. Every time I click back and move to another page it increase number on events firing.
I use this code for event
$$(document).on(“click”, “.forward”, function()

please help.

Thanks.

Solved. Use this code, instead of document
$$(’.forward’).on(“click”, function(){

Hi @arkady_shakhnovich, @nolimits4web

I have same problem and I am also using
$$(document).('click', '.addToCart', function() {});
because I am rendering page using template7 and in this scenario
$$('.addToCart').('click', function() {});
this click event does not work nor get fired.

Any help in this matter?

$$(document).on(‘click’, ‘.addToCart’, function() {});

Apply .on(“click”)
and second, if you are using this code inside on page init, keep this code out of it and declare/use/define it in another file. Such as app.js. Hope, it will help you.

Wow. 2yr old revival…

Anyway, while we’re here, if you are unsure you have defined this before, the lazy way would be to turn off all click events and add the one you want:

$().off('click').on('click', () => {});