官术网_书友最值得收藏!

Solution #5 - disable the button

A similar idea: instead of removing the event handler, disable the button, so the user won't be able to click. You might have a function like the following:

function billTheUser(some, sales, data) {
document.getElementById("billButton").setAttribute("disabled", "true");
window.alert("Billing the user...");
// actually bill the user
}

This also works, but we still have objections as for the previous solutions (coupling the code to the button, need to re-enable the button, harder testing), so we don't like this solution either.

主站蜘蛛池模板: 双牌县| 清水河县| 和政县| 墨竹工卡县| 易门县| 临桂县| 舟山市| 山西省| 麻江县| 柏乡县| 梨树县| 新兴县| 龙井市| 六盘水市| 汝阳县| 峨眉山市| 阳朔县| 无为县| 广饶县| 阜宁县| 甘德县| 韶关市| 尖扎县| 崇州市| 大埔县| 襄汾县| 阳山县| 新蔡县| 太仆寺旗| 菏泽市| 富宁县| 来凤县| 大姚县| 泗水县| 进贤县| 阿拉善右旗| 泗水县| 仁寿县| 兴隆县| 阜康市| 汝南县|