SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Waiting for user input without confirm/alert

    Hi,
    I have a flash movie playing in a browser window, and I found a solution to skip the "are you sure you want to navigate away from this page" by using this.focus();
    self.opener = this;
    self.close();

    in onbeforeunload(). I played around with it and realized that I can change the message up with alert/confirm.
    Now the problem is that I made a pretty exit prompt (in a div layer) and realized that I can't use it because I don't know how to make the browser wait for a button to be pressed before proceeding to unload().

    Also, the above code closes the "navigate away" window, but is it possible to automatically have the browser press cancel instead of proceeding to unload?

    Thanks,

  2. #2
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i just noticed that i can't do confirm() and have the user cancel and still remain on the same page.

    so, is there no coming back after the user clicks the "X" unless i keep the "are you sure you want to navigate away" warning?

  3. #3
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not with javascript, and not in any browser that isn't from Microsoft.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •