Javascript 如何在以下情况下启用功能;“关闭”;按钮在jAlert中按下
当用户提供错误的身份验证凭据时,但在弹出jAlert后,以及恰好在按下jAlert的关闭btn后,我尝试将页面重定向回,但我无法这样做。请帮我完成这项任务。提前感谢Javascript 如何在以下情况下启用功能;“关闭”;按钮在jAlert中按下,javascript,Javascript,当用户提供错误的身份验证凭据时,但在弹出jAlert后,以及恰好在按下jAlert的关闭btn后,我尝试将页面重定向回,但我无法这样做。请帮我完成这项任务。提前感谢 代码如下: <script> $(document).ready(function () { $.jAlert({ 'title': 'Authentication Error', 'content': 'Invalid Username
代码如下:
<script>
$(document).ready(function () {
$.jAlert({
'title': 'Authentication Error',
'content': 'Invalid Username of Password"!',
'theme': 'blue',
'btns': { 'text': 'close' }
});
});
</script>
$(文档).ready(函数(){
贾勒特先生({
'title':'Authentication Error',
“内容”:“密码的用户名无效”!”,
“主题”:“蓝色”,
'BTN':{'text':'close'}
});
});
jAlert插件提供了一个onClose
函数,当模式被解除时,该函数将触发。定义您想要在函数中的行为,例如:
<script>
$(document).ready(function() {
$.jAlert({
'title': 'Authentication Error',
'content': 'Invalid Username or Password!',
'theme': 'blue',
'btns': { 'text': 'close' },
'onClose': function(alertElem) {
// alert("Redirecting...");
window.location = "index.html";
}
});
});
</script>
$(文档).ready(函数(){
贾勒特先生({
'title':'Authentication Error',
“内容”:“无效的用户名或密码!”,
“主题”:“蓝色”,
'BTN':{'text':'close'},
“onClose”:函数(alertElem){
//警报(“重定向…”);
window.location=“index.html”;
}
});
});
请参阅位于的jAlert文档