어느 가을날의 전환점

JavaScript|브라우저(Browser) 닫기(Close) 스크립트 본문

Development

JavaScript|브라우저(Browser) 닫기(Close) 스크립트

어느가을빛 2010. 1. 15. 11:15
function fnc_CloseWindow() {
var brVer = navigator.userAgent;
var brVerId = brVer.indexOf('MSIE');
var brNum = brVer.substr(brVerId, 8);
var brVerNum = brNum.substr(5, brNum.length);

if(parseFloat(brVerNum) >= 7){
//window.open('about:blank','_self').close();
window.open('', '_self', '');
window.close();
} else if(parseFloat(brVerNum) = 6){
window.opener = null;
window.close();
} else { 
//window.opener = self;
window.opener = '';
self.close();
}
}
Comments