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

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.

主站蜘蛛池模板: 军事| 冕宁县| 溧阳市| 黔西县| 山东| 鄯善县| 藁城市| 霍林郭勒市| 宜章县| 阜阳市| 四平市| 桂平市| 承德县| 什邡市| 黎城县| 信丰县| 九龙坡区| 洪洞县| 六枝特区| 宁海县| 三穗县| 丹东市| 德昌县| 龙胜| 全椒县| 天柱县| 同德县| 娱乐| 阜城县| 乌鲁木齐市| 南充市| 平泉县| 五台县| 双鸭山市| 都昌县| 乐安县| 满洲里市| 望奎县| 迁西县| 文山县| 宁都县|