I have a button that calls a javascript function using an event handler. For some reason, the event handler is being called twice.
Here is my button (I am using a ph
You probably want to pass in the event and add
$('.addToCartButton').click(function(e) {
e.preventDefault(); //Added this
alert("bob");
//addToCart($(this).attr("id"));
});
OR
$('.addToCartButton').click(function(e) {
e.preventDefault(); //Added this
alert("bob");
//addToCart($(this).attr("id"));
return false;
});