HTTPAuth Logout in Chrome, Firefox and IE with jQuery
$( function (){ $( '#user_logout' ).on( 'click' , function (e){ // HTTPAuth Logout code based on: http://tom-mcgee.com/blog/archives/4435 e.preventDefault(); try { // This is for Firefox $.ajax({ // This can be any path on your same domain which requires HTTPAuth url: "/any/path" , username: 'reset' , password: 'reset' , // If the return is 401, refresh the page to request new details. statusCode: { 401: function () { document.location = document.location; } } }); } catch (exception) { // Firefox throws an exception since we didn't handle anything but a 401 above // This line works only in IE if (!document.execCommand( "ClearAuthenticationCache" )) { // exeCommand returns false if it didn't work (which happens in Chrome) so as a last // resort refresh the page providing new, invalid details. document.location = "http://reset:reset@" + document.location.hostname + document.location.pathname; } } }); }); 다음으로 이동:http://patabugen.co.uk/2013/12/09/httpauth-logout-in-chrome-firefox-and-ie-with-jquery/
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
xp 사용cmdshell 로그아웃 Windows 로그 인 사용자(터미널 서버 최대 연결 수 초과)회사 의 일상적인 프로젝트 업 데 이 트 는 TFP 를 사용 합 니 다.서버 는 일반적으로 원 격 데스크 톱 으로 관리 되 기 때문에 서버 에 자주 로그 인 합 니 다.그러나 어떤 이유 로 서버 에 로그 인 한 후에...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.