Closing browser windows
Moderator: General Moderators
- Seitan end Yvl
- Forum Newbie
- Posts: 4
- Joined: Wed Apr 02, 2003 1:23 am
- Location: Lithuania
- Contact:
Closing browser windows
hi, to all.
I have slight problem:
i want my php file to open download box for user with file, i want to download, so i use current command:
echo "<script>location='somefile.zip'</script>";
but now, i want my page to close after 5 seconds.
how may i do that?
I have slight problem:
i want my php file to open download box for user with file, i want to download, so i use current command:
echo "<script>location='somefile.zip'</script>";
but now, i want my page to close after 5 seconds.
how may i do that?
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- Seitan end Yvl
- Forum Newbie
- Posts: 4
- Joined: Wed Apr 02, 2003 1:23 am
- Location: Lithuania
- Contact:
code
coud you help me out with some code example, please?
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- Seitan end Yvl
- Forum Newbie
- Posts: 4
- Joined: Wed Apr 02, 2003 1:23 am
- Location: Lithuania
- Contact:
nope
Nope, the same bug :)
echo '<script language="JavaScript">';
echo 'function closeWin() {';
echo ' setTimeout("window.close();", 5000);}';
echo "</script>";
echo "<script>location='closeWin()'</script>";
echo "<br><br>Window will close in 5 seconds";
echo "<script>location='somefile.zip'</script>";
works only the LAST script, - if the last will be
echo "<script>location='somefile.zip'</script>";
opens download dialog box, but window does not close, if the last is
echo "<script>location='closeWin()'</script>";
window closes, but no dialog is displayed.
echo '<script language="JavaScript">';
echo 'function closeWin() {';
echo ' setTimeout("window.close();", 5000);}';
echo "</script>";
echo "<script>location='closeWin()'</script>";
echo "<br><br>Window will close in 5 seconds";
echo "<script>location='somefile.zip'</script>";
works only the LAST script, - if the last will be
echo "<script>location='somefile.zip'</script>";
opens download dialog box, but window does not close, if the last is
echo "<script>location='closeWin()'</script>";
window closes, but no dialog is displayed.
- Seitan end Yvl
- Forum Newbie
- Posts: 4
- Joined: Wed Apr 02, 2003 1:23 am
- Location: Lithuania
- Contact:
:)
no idea...
tried to use
echo "<script>location='javascript:closeWin()'</script>";
the same problem :(
tried to use
echo "<script>location='javascript:closeWin()'</script>";
the same problem :(
Code: Select all
<script language="Javascript" type="text/javascript">
<!--
setTimeout("window.close();", 5000);
//-->
</script>