Jump to content


Photo

closing the current window


  • Please log in to reply
2 replies to this topic

#1 hanhao

hanhao
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 04 June 2006 - 10:10 AM

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

anyone knows the command to close the window?

would

echo "self.close()";
?

be correct?

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

- hanhao

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 04 June 2006 - 10:12 AM

You can only close a window with javascript so you'll want to use this:
echo "<script  type=\"text/javascript\">window.close();</script>";


#3 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 04 June 2006 - 03:06 PM

If you need to close it after 5 seconds, you can use setTimeout()

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

~ D Kuang




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users