Asp.net 프로젝트의 모든 페이지에서 사용되는 간단한 JavaScript 확인 함수를 사용하고 을 jQuery 확인 대화 상자으로 바꾸고 싶습니다. Apprise jQuery 확인 대화 상자 라이브러리를 사용합니다. 하지만 jQuery 확인 대화 상자의 비동기 작업으로 인해 문제가 발생합니다. 이 나의 새로운 비동기 jQuery를 대화 기능을비동기 JQuery 확인 대화 상자를 동기식으로 사용하는 방법은 무엇입니까?
function confirmForOperation(message) {
apprise(message, { 'verify': true, 'animate': true, 'textYes': 'Yes', 'textNo': 'No' },
function (r) {
if (r) {
// User clicked YES..
return true;
}
else {
// User clicked NO..
return false;
}
});
}
을 확인입니다
function confirmForOperation(message) {
if (confirm(message) == true)
return true;
else
return false;
}
내 옛날 자바 스크립트 확인 기능이
입니다 .. 내가 당신에게 내 프로젝트의 일부 코드 예제를 들어 보겠습니다
아래 기능을 사용 하시겠습니까?
,function confirmForOperation(message, callBack) {
apprise(message, { 'verify': true, 'animate': true, 'textYes': 'Yes', 'textNo': 'No' },
function (r) {
if (r) {
// User clicked YES..
if ($.isFunction(callback)) {
callback.apply();
}
}
else {
// User clicked NO..
return false;
}
});
}
그러나 지역 (코드) 나는이 확인 대화 기능을 사용 중 하나는 다음과 같습니다 때문에 콜백 메커니즘은 나를 위해 작동하지 않습니다
<asp:Button ID="btnDelete" runat="server" CausesValidation="false" CommandName="Delete"
Text="<%$ Resources:BTNResource, BUTTON_DELETE_LABEL %>" OnClientClick="return confirmForOperation();" />
어떤 생각?