Code Hungry
Code Hungry

Reputation: 4000

Strictly close Browser window without YES/NO option window.close();

I would like to strictly close Browser window with "OK" button instead of "YES/NO" enter image description here

<body onload="javascript:window.opener='x';window.close();">

Upvotes: 1

Views: 860

Answers (1)

glw
glw

Reputation: 1664

Try this:

<script type="text/javascript">
    function closeWithOKButton(){
        alert('Some info');
        window.open('','_self').close();
    }
</script>

Upvotes: 1

Related Questions