I have a JavaScript function that is being called multiple times. It appears the createUser function gets added as an array and is called each time someone clicks the “Add Bidder” link.
<a id="add_bidders_14" class="bidders" href="#" vendor_id="123"> Add Bidder </a>
Here is the a Javascript functions
function addClickBehavior() {
$("#add_bidders_14").click( function () {
var data_object = {};
data_object.vendor_id = $(this).attr("vendor_id");
bidderModal()
}
}
function bidderModal(data_object) {
createUser(data_object);
}
function createUser(data_object) {
alert("I pop up more and more each click to the Add Bidder link");
}
What I want to happen is that a new createUser function to occur on every click and not create multiple instances of createUser. So in reality the alert will only fire once.
You want unbind