This is what I would try:
$("a.button").one("click", function() {
$(this).click(function () { return false; });
});
Bind all the links with class "button". Run the anonymous function only once (hence "one"), which rebinds the link to return false.
If you want to keep it looking more like what you have, try this:
$("a.button").click(function() { $(this).attr("disabled", "disabled"); });
$(document).click(function(evt) {
if ($(evt.target).is("a[disabled]"))
return false;
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…