I had a image which calls add_cart() JavaScript function when onclick()
add_cart()
onclick()
<
If you are dealing this on jquery side,you can use jquery one method
one
$(".myDiv").one("click", function(){ alert("this will happen only once"); });
Cheers