Jump to content

Archived

This topic is now archived and is closed to further replies.

hanhao

closing the current window

Recommended Posts

ok i need to self close a window (like after 5 seconds)

anyone knows the command to close the window?

would

[code=php:0]echo "self.close()"; [/code] ?

be correct?

if not, please tell me what i have left out with a counter example

- hanhao

Share this post


Link to post
Share on other sites
You can only close a window with javascript so you'll want to use this:
[code]echo "<script  type=\"text/javascript\">window.close();</script>";[/code]

Share this post


Link to post
Share on other sites
If you need to close it after 5 seconds, you can use setTimeout()

[code]<script type="text/javascript">
setTimeout("window.close()" , 5000);
</script>[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.