- I need to know if the user close the browser:
- Code: Select all
<script type="text/javascript">
window.onbeforeunload = function () {
return "Do you really want to close this window?";
}
</script>
- or to open the window – browser without or with a disable close window button:
You can disable the resize button (on IE), but you cannot disable the close button, try:
- Code: Select all
<script type="text/javascript">
function openWin(obj) {
window.open(obj.getAttribute('href'),'window_name',
"height=200,width=400,status=yes,toolbar=no,menubar=no,location=no,resizable=no");
}
</script>
<a href="http://www.google.com" onclick="openWin(this);return false;">Open Google</a>
Hope that helps.