Close the current page – how to?

Discussion in 'JavaScript' started by datrader, Feb 13, 2012.

  1. #1
    Hi all,

    I have a form that redirects to a thank you page after submission. I want this thank you page to be closed after a few seconds.
    The redirection to this thank page is via php.

    The form doesn’t open via JS or popup, it’s a part of a page.

    Window.close(); doesn’t work for me here (on IE it works, but not on FF or chrome).
    Anyone knows how to close a page without user permission?
     
    datrader, Feb 13, 2012 IP
  2. JohnnySchultz

    JohnnySchultz Peon

    Messages:
    277
    Likes Received:
    4
    Best Answers:
    7
    Trophy Points:
    0
    #2
    the only way to close a window is throught window.close();

    the only window you can close without the user's permission is a pop-up window, if you're closing a parent window a confirmation dialog will appear..

    why not create a js pop-up to put your message there, in that way you have the control to remove that pop-up.. an example would be jquery dialog
     
    JohnnySchultz, Feb 15, 2012 IP
  3. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #3
    Look for modal alerts. Some of them have timed closes as well as click closes.
     
    Rukbat, Feb 25, 2012 IP