I have a click handler that is firing twice even though it is only defined in 1 file. When debugging, and looking at the click handlers on that element, I see there are 2 script files that have registered the click event, the normal file and a mysterious VM - "myfile" that I did not make. How do I stop it hitting the unwanted VM script?
edit:
html is simply: <a href="#" id="clear-matches">Clear matches</a>
function:
$('#clear-matches').click(function (e) {
e.preventDefault();
bootbox.dialog({
message: "Are you sure? This will delete all your matches from all divisions for the latest season!!",
buttons: {
btn1: {
"label": "Cancel",
"className": "btn-default"
},
btn2: {
"label": "Delete",
"className": "btn-danger",
"callback": function () {
var data = { leagueId: leagueId }
$.post(window.rootUrl + "League-ClearMatches",
data,
function (result) {
bootbox.alert(result);
});
}
}
}
});
});