I have this code in a common javascript file in my asp.net project.
jQuery-Lint returns "You've used the same selector more than once" whenever I mouse over one of the buttons that was affected by this function.
//turns all the buttons into jqueryUI buttons
//#mainBody is on the master page, #childBody is on the modal page.
$("#mainBody button, #mainBody input:submit, #mainBody input:button, #childBody button, #childBody input:submit, #childBody input:button").livequery(function () {
$(this).button().each(function (index) {
$(this).ajaxStart(function () {
$.data(this, "old_button_val", $(this).val());
$.data(this, "old_button_disabled", $(this).button("option", "disabled"));
$(this).button("option", "disabled", true).val("Wait...");
}).ajaxStop(function () {
$(this).val($.data(this, "old_button_val")).button("option", "disabled", $.data(this, "old_button_disabled"));
}).ajaxError(function () {
$(this).val($.data(this, "old_button_val")).button("option", "disabled", $.data(this, "old_button_disabled"));
});
});
});
A similar question was asked here.
Disclaimer: Not tested, therefore not guaranteed to work.