後返回true正確的值,我試圖找到wheather在數據的基礎上它總是如此的回報存在於第一次嘗試始終在第一個調用返回第一個電話
var IsEmailExistinInthemo = true;
function EmailRegVerify(email) {
var url = '/_service/setVerifyProfiles.ashx';
var pars = '&email=' + email;
var target = 'output-div';
var myAjax = new Ajax.Updater(target, url, { method: 'get', parameters: pars,
onSuccess: function(transport) {
var response = transport.responseText || "no response text";
if (response == "True") {
$('errorMsg_Email').show();
$('errorMsg_Email').innerHTML = 'Email address has already been registered with IntheMO';
IsEmailExistinInthemo = false;
}
else {
$('errorMsg_Email').hide();
}
},
oncomplete:function(){
},
onFaliure: function() {
//msg: something went wrong
}
});
return IsEmailExistinInthemo;
}
是否有任何我可以看看的例子... – dsadsad 2010-10-05 02:06:28