Reputation: 121
hi i have written code for opening the child window with disabled toolbar and menu bar in IE. i have written the code in parent.jsp.
For IE version 8 the problem i face is it shows the pop-up saying
"Do you want to close the window ? Yes or No ".
I dont want to this pop-up to be shown in IE 8
the below code does not show the popup IE version 6, but its not working for IE 8
the code is
window.opener=top;
window.close();
window.open('link',toolbar=no,menubar=....);
can someone pls help me with a bit of code to not to show this popup and close automatically for all versions of IE??
Upvotes: 2
Views: 6943
Reputation: 54117
You're running into a browser security feature - assuming that you're creating a site for public consuption, don't fight it.
Upvotes: 1
Reputation: 344301
In IE7 and IE8 you cannot close a window without the security warning, unless the window was previously opened programmatically with JavaScript. One possible workaround is to let the browser think that the parent window was opened programmatically. The following should silently close the parent window after opening the child window:
window.open('link', 'toolbar=no,menubar=...');
window.open('', '_self', '');
window.close();
Sources and further information:
Upvotes: 1