Because of the security enhancements in IE7, you can't close a window unless it is opened by a script. so the walkaround will be to let the browser thinks that this page is opened using a script then closing the window.
Please check the link below for the similar thread which provides a solutions for the issue: http://stackoverflow.com/questions/601465/the-webpage-you-are-viewing-is-trying-to-close-this-window-warning-in-internet-ex
hope this helps, thanks.
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact email@example.com
Microsoft One Code Framework
Thank you Mr. Yang,
I create a function like this :
When, I press on "Quit" button, the portal page is appearing to replace application page.
I don't know if it's the best but I think I have a solution.
I also tried code like this one, but I can't catch error:
//Run some code here
//Handle errors here
My regards. Bye.
Mr Html-db apex developper
At our office, one of our IE8 versions is hitting the "The Webpage you are viewing is trying to close the window. Do you want to close this window" message, but the other is not. They're they exact same version of IE, and we're very sure that it's a settings difference, but we have been unable track down the difference. Does anyone here know which setting it might be that I can toggle?
1. Security tab, click "Reset all zones to default"
2. Compare the listing of sites in the Trusted and Internet Zones..... client machines on different Domains may have different Group Policy settings.
(scripted windows, viz popups and navigation accross domains is affected by security zone settings.. always accept the default.)
3. Tools>Popup blocker>Popup blocker settings>a Meduim Blocking level stops most advertisements but still leaves legitimate popups available.
4. Tools>Compatibility View Settings..... compare the settings between the two machines...
Display the Developer Tool and compare the Document Mode that the page renders as on both machines.
the machine that does not display the warning may have "Display all sites in Compatibility View" checked....
5. test both machines in no-Addons mode to rule out an Addon.