Click here to Skip to main content
16,018,057 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
See more:
XML
<script>
function closeCurrentWindow() {
            var version=0;
            if (navigator.appVersion.indexOf("MSIE")!=-1){
                        var temp=navigator.appVersion.split("MSIE");
                        version=parseFloat(temp[1]);
            }
            if (version>=5.5 && version<=6) {
                        this.focus();
                        self.opener = this;
                        self.close();
            } else {
                        window.open('','_parent','');
                        window.close();
            }
}

</script>
<body onload= closeCurrentWindow()>




This code is to close the current window but it is working only with IE not with Chrome and Firefox
Posted

Try this:

C#
window.open('', '_self', '');
window.close();


Check here for more info:Chrome Issue
 
Share this answer
 
v2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900