Java Popup on Leave Problem

Discussion in 'HTML' started by Steve Horrillo, Jun 24, 2005.

  1. I'm also having trouble with a popup on leave javascript. It seems that it
    pops up when I browse to another page instead of waiting till I completely
    leave my site. What am I doing wrong. Mind you, I'm using Front Page. I have
    it installed at www.over100percent.com. Here's the script I'm putting into
    the head section. Does this need to be on every page?

    I HAVE THIS IN THE HEAD...

    <script language="JavaScript">

    <!-- Begin
    function leave() {
    window.open('http://over100percent.com/popup_on_leave.htm','','toolbar=no,menubar=no,location=no,height=385,width=300');
    }
    // End -->
    </script>


    THEN IN THE BODY I HAVE...


    <BODY onUnload="leave()" style="text-align: left"><div align="left"><font
    size="2" face="Arial" color="black"><SCRIPT LANGUAGE="JavaScript">




    --
    Warmest regards,

    Steve Horrillo, Realtor / CEO / C.Ht.
    http://brokeragenttraining.com (Advanced training for real estate
    professionals)
    http://over100percent.com (Realtors earn over 100 percent)
    http::/hipfsbo.com (A helpful place for the serious home seller or buyer who
    is open to new ideas)
    Steve Horrillo, Jun 24, 2005
    #1
    1. Advertising

  2. Steve Horrillo

    microchip Guest

    1.Yet again, you forgot the <!---------begin slashes

    2.That is how the script is supposed to work.

    3.You could put a "Exit Site" button on your site that leads to a page
    that says "Thanks for visiting" or something like that, and you can put
    the script on that page. Other than that, I see no other way using only
    JS.
    microchip, Jun 24, 2005
    #2
    1. Advertising

  3. Steve Horrillo

    Mark Parnell Guest

    Previously in alt.html,comp.lang.javascript,alt.www.webmaster, Steve
    Horrillo <> said:

    http://www.dannyg.com/ref/javavsjavascript.html

    > I'm also having trouble with a popup on leave javascript.


    They don't trouble me. Doesn't your browser block popups? :p

    > What am I doing wrong.


    Where do I start? :)

    > Mind you, I'm using Front Page.


    Well, there's the first answer to your previous question, though not
    necessarily relevant to this post as such.

    > It seems that it
    > pops up when I browse to another page instead of waiting till I completely
    > leave my site.


    Correct.
    "The onunload event occurs when the user agent removes a *document* from
    a window or frame." (emphasis mine)
    http://www.w3.org/TR/html401/interact/scripts.html#adef-onunload

    How are you supposed to know whether they are leaving the current page
    to go to another page on your site, or to a different site? More to the
    point, why do you think you have a right to know?

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    Mark Parnell, Jun 24, 2005
    #3
  4. Steve Horrillo

    Mark Parnell Guest

    Previously in alt.html,comp.lang.javascript,alt.www.webmaster, microchip
    <> said:

    > 1.Yet again, you forgot the <!---------begin slashes


    Just get rid of the HTML comment altogether. It's not necessary.

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    Mark Parnell, Jun 24, 2005
    #4
  5. Steve Horrillo

    Noozer Guest

    "Steve Horrillo" <> wrote in message
    news:hIKue.825$...
    > I'm also having trouble with a popup on leave javascript. It seems that it
    > pops up when I browse to another page instead of waiting till I completely
    > leave my site. What am I doing wrong. Mind you, I'm using Front Page. I

    have
    > it installed at www.over100percent.com. Here's the script I'm putting into
    > the head section. Does this need to be on every page?


    A) Popup's are evil... Why do you feel the need to bother your user?

    B) The script is working as it should... You leave that page (regardless of
    what else is in the browser) so it fires the event.

    C) If you using Frames (also evil) why the need for a popup?

    Thx!
    Noozer, Jun 24, 2005
    #5
  6. Steve Horrillo

    mark | r Guest

    thats just EVIL

    if someone wants to leaved your site, why annoy them with advertising

    mark
    www.iosilver.co.uk
    Sterling Silver Jewellery
    "Steve Horrillo" <> wrote in message
    news:hIKue.825$...
    > I'm also having trouble with a popup on leave javascript. It seems that it
    > pops up when I browse to another page instead of waiting till I completely
    > leave my site. What am I doing wrong. Mind you, I'm using Front Page. I

    have
    > it installed at www.over100percent.com. Here's the script I'm putting into
    > the head section. Does this need to be on every page?
    >
    > I HAVE THIS IN THE HEAD...
    >
    > <script language="JavaScript">
    >
    > <!-- Begin
    > function leave() {
    >

    window.open('http://over100percent.com/popup_on_leave.htm','','toolbar=no,me
    nubar=no,location=no,height=385,width=300');
    > }
    > // End -->
    > </script>
    >
    >
    > THEN IN THE BODY I HAVE...
    >
    >
    > <BODY onUnload="leave()" style="text-align: left"><div align="left"><font
    > size="2" face="Arial" color="black"><SCRIPT LANGUAGE="JavaScript">
    >
    >
    >
    >
    > --
    > Warmest regards,
    >
    > Steve Horrillo, Realtor / CEO / C.Ht.
    > http://brokeragenttraining.com (Advanced training for real estate
    > professionals)
    > http://over100percent.com (Realtors earn over 100 percent)
    > http::/hipfsbo.com (A helpful place for the serious home seller or buyer

    who
    > is open to new ideas)
    mark | r, Jun 24, 2005
    #6
  7. In article <>,
    says...
    > 1.Yet again, you forgot the <!---------begin slashes


    Yet again you forgot to quote the message to which you're replying.

    --
    Hywel

    Kill the Crazy Frog
    http://www.petitiononline.com/crzyfrg/
    Hywel Jenkins, Jun 24, 2005
    #7
  8. Steve Horrillo

    Andy Dingley Guest

    On Fri, 24 Jun 2005 03:03:49 GMT, "Steve Horrillo"
    <> wrote:

    >I'm also having trouble with a popup on leave javascript.


    Good.

    >Mind you, I'm using Front Page.


    You're made for each other.
    Andy Dingley, Jun 24, 2005
    #8
  9. Steve Horrillo wrote:
    > I'm also having trouble with a popup on leave javascript..


    I assume this is a porn site as they are the kinds of sites that usually
    use things like this.

    Not that I know that from experience mind you...

    --
    -=tn=-
    Travis Newbury, Jun 24, 2005
    #9
  10. Steve Horrillo

    Dan Guest

    Steve Horrillo wrote:
    > What am I doing wrong. Mind you, I'm using Front Page.


    You've answered your own question, haven't you? :)

    --
    Dan
    Dan, Jun 24, 2005
    #10
  11. Steve Horrillo

    Neredbojias Guest

    With neither quill nor qualm, Travis Newbury quothed

    > Steve Horrillo wrote:
    > > I'm also having trouble with a popup on leave javascript..

    >
    > I assume this is a porn site as they are the kinds of sites that usually
    > use things like this.
    >
    > Not that I know that from experience mind you...


    Well good guess! Er, I guess.

    --
    Neredbojias
    Contrary to popular belief, it is believable.
    Neredbojias, Jun 25, 2005
    #11
  12. Steve Horrillo

    Neredbojias Guest

    With neither quill nor qualm, Steve Horrillo quothed

    > I'm also having trouble with a popup on leave javascript. It seems that it
    > pops up when I browse to another page instead of waiting till I completely
    > leave my site. What am I doing wrong.


    As somebody else already indicated, how is "it" supposed to know when a
    user leaves your site as opposed to just the page?

    It is bad to use pop-ups for negative reasons. I'd venture to say that
    at least 50% of users block them now because of assholes who install
    pop-ups and -unders to advertise crap.

    --
    Neredbojias
    Contrary to popular belief, it is believable.
    Neredbojias, Jun 25, 2005
    #12
  13. Steve Horrillo

    Guest

    On 24-Jun-2005, "Dan" <> wrote:

    > > What am I doing wrong. Mind you, I'm using Front Page.

    >
    > You've answered your own question, haven't you? :)


    What's wrong with Front Page?
    , Jun 25, 2005
    #13
  14. Steve Horrillo

    Randy Webb Guest

    wrote:
    > On 24-Jun-2005, "Dan" <> wrote:
    >
    >
    >>>What am I doing wrong. Mind you, I'm using Front Page.

    >>
    >>You've answered your own question, haven't you? :)

    >
    >
    > What's wrong with Front Page?


    It's easier to answer the question the other way around:

    Question: What's right with Front Page?
    Answer: Nothing.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Randy Webb, Jun 25, 2005
    #14
  15. Steve Horrillo

    Andy Dingley Guest

    On Sat, 25 Jun 2005 05:37:06 GMT,
    wrote:

    >What's wrong with Front Page?


    Cooties.
    Andy Dingley, Jun 25, 2005
    #15
  16. wrote:
    >>>What am I doing wrong. Mind you, I'm using Front Page.

    >>You've answered your own question, haven't you? :)

    > What's wrong with Front Page?


    Nothing is wrong with Front Page. If you depend on it to write your
    code for you, you will have some pretty sloppy and bloated code. If you
    use it as an editor, then it is just as good (in some cases better) than
    the others out there.

    --
    -=tn=-
    Travis Newbury, Jun 25, 2005
    #16
  17. Mark Parnell wrote:

    > Previously in alt.html,comp.lang.javascript,alt.www.webmaster, microchip
    > <> said:
    >
    >> 1.Yet again, you forgot the <!---------begin slashes

    >
    > Just get rid of the HTML comment altogether. It's not necessary.


    1. It is intended as a comment within an SGML declaration `<! ... >'.
    2. It is not a valid SGML comment as those comments start and end with `--'.
    3. It is not only no longer necessary here, it was error-prone right
    from the start and should never made it in any way into the HTML 3.2+
    Specifications in the first place, not even as an example.


    PointedEars
    Thomas 'PointedEars' Lahn, Jul 12, 2005
    #17
  18. Travis Newbury wrote:

    > wrote:
    >>>> What am I doing wrong. Mind you, I'm using Front Page.
    >>> You've answered your own question, haven't you? :)

    >> What's wrong with Front Page?

    >
    > Nothing is wrong with Front Page. If you depend on it to write your
    > code for you, you will have some pretty sloppy and bloated code. If you
    > use it as an editor, then it is just as good (in some cases better) than
    > the others out there.


    The only problem is that FrontPage interferes with certain source code you
    write if you save the document (i.e. it silently deletes it even if its
    valid) which makes it hardly a good source code editor.

    Please keep HTML stuff, if not related to scripting, out of cljs.
    Please avoid (excessive) crossposts without Followup-To.


    PointedEars, F'up2 microsoft.public.frontpage.client
    Thomas 'PointedEars' Lahn, Jul 12, 2005
    #18
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gianmaria I.

    User can leave the page?

    Gianmaria I., May 24, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    333
    Gianmaria I.
    May 24, 2004
  2. Dot net work
    Replies:
    4
    Views:
    523
    Dot net work
    Jun 16, 2004
  3. Stan Sainte-Rose

    Leave Event TextBox

    Stan Sainte-Rose, Jun 16, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    7,144
    Earl Teigrob
    Jun 16, 2004
  4. Jens Peter Hansen
    Replies:
    7
    Views:
    498
    Randy Webb
    Jun 19, 2004
  5. Replies:
    2
    Views:
    445
Loading...

Share This Page