Code:
<script language="javascript" type="text/javascript">
function closeWindow() {
window.open('','_parent','');
window.close();
}
</script>
|
Go4Expert Member
|
|
| 23Jun2009,20:04 | #1 |
|
i am running the following script:
Code:
<script language="javascript" type="text/javascript">
function closeWindow() {
window.open('','_parent','');
window.close();
}
</script>
|
|
~ Б0ЯИ Τ0 С0δЭ ~
|
![]() |
| 23Jun2009,20:09 | #2 |
|
Try this :
Code: JavaScript
|
|
Go4Expert Member
|
|
| 23Jun2009,20:17 | #3 |
|
i just tried what you said, but it still isnt working.
|
|
~ Б0ЯИ Τ0 С0δЭ ~
|
![]() |
| 23Jun2009,20:29 | #4 |
|
OK. I read this in the mozilla forum :
Quote:
|
|
Banned
|
|
| 25Jun2009,15:18 | #5 |
|
However, in some browsers it is not allowed to automatically close windows that have not been opened by JavaScript. The line above works fine in Explorer on Mac, Mozilla, Opera and OmniWeb, but not in Explorer on Windows, Netscape 4 and lower and iCab. In these browsers the user is asked to confirm the closing of the window. As to Safari, it does absolutely nothing.
Rather to my surprise it's very easy to get around this confirm box in Explorer 5.5 and 6 on Windows. Explorer merely looks if the page has an opener. If it doesn't the window has been opened by the user and may not be closed without a confirm. So what we need to do is trick Explorer into thinking the opening page has an opener: Code:
opener.opener = top; // or whatever, as long as opener.opener has a value; opener.close() |