0
我想让浏览器在if()循环中显示403(禁止页面)if()代替window.location ='unauth.html'语句。我不想重新路由到unauth.html页面。我怎样才能做到这一点?在JavaScript中路由到403页面
$(document).ajaxComplete(function (event, xhr, settings) {
if (xhr.responseText.indexOf('Unauthorized access') >= 0)
// Show unauthorized page
window.location = 'unauth.html';
});
那不是一个循环,这是一个回调。它有用吗?有错误吗?什么样的错误? – Tim 2013-04-08 17:30:23
Tim,我不想使用unauth.html,而想将该语句(window.location ='unauth.html';)替换为显示403禁止页面的内容。我怎样才能做到这一点? – paxglobal 2013-04-08 18:18:20