내가 코드 아래와 같이이 자바 스크립트에서 함수 후 $를 (문서) .ready (함수() {}) 추가 할 수 있습니다 이 코드를 추가하여 다른 코드를 추가하고 작업하십시오. 이 코드를 추가해야합니다.어떻게 내가 원하는 무엇
function() {
/* If there are forms, make all the submit buttons in the page appear
disabled and prevent them to be submitted again to avoid accidental
double clicking. See Issue 980. */
jQuery(function() {
/* Delegate the function to document so it's likely to be the last event
in the queue because of event bubbling. */
jQuery(document).delegate("form", "submit", function (e) {
var form = jQuery(this);
if (form.hasClass("form_disabled")) {
e.preventDefault();
return false;
}
else {
form
.addClass("form_disabled")
.find(":submit")
.addClass("disabled");
}
// Reactivate the forms and their buttons after 3 secs as a fallback.
setTimeout(function() {
form
.removeClass("form_disabled")
.find(":submit")
.removeClass("disabled");
}, 3000);
});
});
}
어떻게 처리 할 수 있습니까? 이 문제를 해결하기 위해 나를 도우십시오.
함수가 무엇을 하는가 : 예를 들어
? 언제 그것을 실행하고 싶습니까? '.click' (예를 들어) 이벤트로 함수를 실행하면 도움이되지 않겠습니까? – zarun