Firefox 4中的基本身份验证未注销
|
我正在使用基本身份验证,并希望使用javascript调用注销(清除凭据)。我编写了以下功能,该功能在IE和Firefox 3.6中有效,但现在在Firefox 4.0中不起作用。有什么解决方法
function Logout()
{
try{
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf(\"msie\") != -1) {
// IE clear HTTP Authentication
document.execCommand(\"ClearAuthenticationCache\");
}
else {
var xmlhttp = createXMLObject();
xmlhttp.open(\"GET\",\".force_logout_offer_login_mozilla\",true,\"logout\",\"\");
xmlhttp.send(\"\");
xmlhttp.abort();
}
// window.location = \"/rest/\";
} catch(e) {
}
}
function createXMLObject() {
try {
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
}
// code for IE
else if (window.ActiveXObject) {
xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");
}
} catch (e) {
xmlhttp=false
}
return xmlhttp;
}
没有找到相关结果
已邀请:
1 个回复
佩疵瓦
如果出现以下错误:
您必须输入
并设置
至