Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Confirm leaving a page?

  1. #1
    Join Date
    Oct 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow Confirm leaving a page?

    how can I make a confirmation button upon leaving a page? I just want to display some text in the alert message, then a ok and cancel buttons...

    when ok is pressed, one leaves the page
    when cancel is pressed, one stays in the page

    how can I do this?

    ps: there is a way that shows "aditional text" rather than only the alert message text I want to put. it says also something like this: "Something is trying to close this window. Are you sure you want to close the window?"
    I don't want this to appear

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Gabber
    how can I make a confirmation button upon leaving a page?
    You can't.

    ps: there is a way that shows "aditional text" rather than only the alert message text I want to put. it says also something like this: "Something is trying to close this window. Are you sure you want to close the window?"
    I don't want this to appear
    Even the approach you describe here is only supported in a limited number of user agents, and they must have scripting enabled for it to occur.

    Why do you need this? Answering that might be more productive.

    Mike

  3. #3
    Join Date
    Oct 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I know the one that says the "extra" text works I've done it myself, but confirm only does not work (cancel button still leaves the page). When a person leaves my site, it is informed of time they entered the site, time they left, and a bye message. I want people to be able to go on and exit or just return if they did nto intended to leave the site...

    so, how can I solve this issue?

    greetz


    ps: I know javascript must be enabled, but for people without javascript won't need this too, since it does not show anything anyway

  4. #4
    Join Date
    Oct 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    can you answer this?

  5. #5
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Gabber
    can you answer this?
    I already told you: you can't[1]. Only the proprietary beforeunload event can be used to stop a page from closing and, by the very nature of proprietary features, it's support is limited.

    If you're trying to perform some kind of logging, do it server-side and show the information on a log out page.

    Mike


    [1] I asked for more information to see if there was an alternative approach. My first answer was always final with regard to doing something on the unload event.

  6. #6
    Join Date
    Oct 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well... I'll show you what I mean, and you will understand...
    check this (it's another version of the homepage)

    http://gabber.no.sapo.pt/indexframe666.htm

    now try to quit. the page is heavuly loaded with scripts, but you will find out quickly what I have done...
    now the problem is that I don't want that "extra" text above and below my owm message...

    Do you see any solution?

  7. #7
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Gabber
    So in other words, this is just another flaky feature which has no useful purpose other than to bulk up an already bloated page?

    Seriously, you have more pressing concerns than whether a pointless script runs just the way you want it to. For a start, ditch Frontpage (one of the worst authoring tools in existence) and learn to write HTML properly. Validate your mark-up and view your page in more than just IE.

    Mike

  8. #8
    Join Date
    Oct 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking

    ermm.. I don't give a damn about Firefox if that is your concern. I don't like their policy any better than Microsoft (imagine seeing websites asking me to install Firefox and not allowing me to see the content in other browser than FF! This happens! If Microcrap did this, everyone would claim them Satan!). And seriously, any browser than needs 100 add-ons for simple things others do in automatic mode is obsolete. Damn, the latest version does not even "color" the scroll bars.

    I use frontpage for editing tables/iframes, somewhat is faster than Dreamweaver for simple things. I use notepad for the rest.

    The feature is flaky, but fun. and this still does not solve the issue. as you see, it worked! but I just don't want the extra text.
    Any clues?


    ps: what is a bloated page? A bit heavy, but I have seen much heavier, specially with flash! all scripts work in IE, Netscape is ok, does now show weird stuff... And it has quite some scripts. even in FF, which shows all very weird, you can still navigate and see content.
    Last edited by Gabber; 01-07-2005 at 01:40 AM.

  9. #9
    Join Date
    Dec 2004
    Posts
    177
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default

    ...the author of the site is responsible for forcing a user to download a specific browser, not the browser itself. Its kind of pointless to simply ignore it, especially since there is a vast majority using it.

    Javascript should definately be used sparingly, even in IE, some users disable it, and SP2 has a conniption with Javascript on its default setting.

    That being said, some people need to realize that not everyone out there is a web designer, and as long as it isn't a professional/business site, it doesn't matter. It pains me to say it, as this seemed to be Microsoft's idea with Frontpage (such horrible code!)...but it's true. If your target audience is only a few, who cares if everyone under the sun can view it, and if it's perfectly validated?

  10. #10
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Gabber
    I don't give a damn about Firefox if that is your concern.
    I was thinking about any browser other than IE.

    I don't like their policy any better than Microsoft
    What policy is that?

    (imagine seeing websites asking me to install Firefox and not allowing me to see the content in other browser than FF! This happens! If Microcrap did this, everyone would claim them Satan!)
    There are sites that require IE and IE only.

    And seriously, any browser than needs 100 add-ons for simple things
    I only have one add-on for Firefox (a user agent spoofer).

    Damn, the latest version does not even "color" the scroll bars.
    If you mean allowing a style sheet to alter the colours, there's no reason to implement it. I find it annoying so it's disabled in Opera. Besides, why do you feel it's your right to mess with the browser chrome?

    I use frontpage
    Other than Microsoft Office components, Frontpage is the worst HTML editor in existence.

    The feature is flaky, but fun.
    Umm, how is showing an alert after I've left your site fun? Most would argue that it's annoying. I equate it to pop-unders.

    Any clues?
    I've said it twice already: you can't. Not in IE. Not in any browser. That much is stated clearly in Microsoft's documentation.

    Mike

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
  •