我正在使用 jquery block UI 插件,我的要求是检查用户是否是授权用户,这是我的代码
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$('#btnsubmit').click(function () {
$.blockUI({ css: {
border: 'none',
padding: '15px',
backgroundColor: '#000',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
opacity: .5,
color: '#fff'
}
});
});
});
function ajaxAuth() {
//UserLogin.IServiceLogin.HelloWorldCC(OnSuccess, OnFailure);
var usrname = document.getElementById('txtusrname').value;
var pasd = document.getElementById('txtpassword').value;
UserLogin.IServiceLogin.GetUseCred(usrname, pasd, onSuccess, onFailed);
}
function onSuccess(result) {
setTimeout($.unblockUI, 0);
var obj = jQuery.parseJSON(result);
if (obj.name != "error" ) {
document.getElementById('labusr').value = obj.name;
document.getElementById('labpass').value = obj.passd;
document.getElementById('labkey').value = obj.key;
location.href = "DesignAPage.aspx";
} else {
$.blockUI({ message: $('#question'), css: { width: '350px'} });
// $('#ok').click(function () {
// $.unblockUI();
// return false;
// });
}
}
function onFailed(result) {
alert("failure");
}
</script>
所以问题是当我使用 $.blockUI({ message: $('#question'), css: { width: '350px'} });
它时,它只会阻塞屏幕一秒钟并解锁屏幕。
任何帮助是极大的赞赏