|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Closing the tabs with conformation in IE7
Hi,
when i the number of tabs in IE7 browser and while closing the single single tabs i need a conformation. I have written the code but this code is working only when i click on the close(X) button only. Code: <html> <script language="javascript"> window.onbeforeunload = function() //author: meizz { var n = window.event.screenX - window.screenLeft; var b = n > document.documentElement.scrollWidth-20; if(b && window.event.clientY < 0 || window.event.altKey) { window.event.returnValue = ""; alert('close'); } } </script> Thanks in advance. |
|
#2
|
|||
|
|||
|
just use this
function HandleOnClose() { // to load a page //window.opener.location.href="URL address www. whatever .com"; // alert alert('You are about to close this page'); } then put this in the <body onbeforeunload="HandleOnClose()"> should work for both IE7 & IE6 with these scenarios: - Alt+F4 - Close X button on toolbar - close X on tab you can even use it for refreshing the parent page with closing pop-up. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Closing the tabs with conformation in IE7 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|