You are here : Blog
Search_Blog Minimize

KHSW Soft Blog Minimize
Aug 27

Written by: Ken Huysmans
2004-08-27T08:35:26 

If you want to close the main browser window, Internet Explorer will popup this messagebox:

"The Web page you are viewing is trying to close the window.
Do you want to close this window?"

Internet Explorer is checking the window.opener object to see if the current window has been opened by another window. If not, it will display this question.

So, the little trick is to make sure that the window.opener object differs from undefined ;-)

<script language="javascript">
function CloseWindow() {
window.opener = 'http://kHSw.blogspot.com';
window.close();
}
</script>

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel 


Copyright 2007 by KHSW Soft BVBA
Privacy StatementTerms Of Use