Ive read earlier that we cannot close the current tab using jQuery or Javascript.
My question is, Is it possible to use the ASCII codes for "ctrl+w" (that is 23) and calling it in jquery/JS to close the current tab?
I tried this code:
<script>
function closethis(){
$(document).keypress(function(e) {
if(e.which == 23) {
alert('Are you sure you want to close?');
}
});
}
</script>
but doesnt work.. any leads??