Java Popup on Leave Problem

S

Steve Horrillo

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_...enubar=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)
 
M

microchip

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.
 
M

Mark Parnell

Previously in alt.html,comp.lang.javascript,alt.www.webmaster, Steve
Horrillo <[email protected]> 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?
 
N

Noozer

Steve Horrillo said:
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!
 
T

Travis Newbury

Steve said:
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...
 
N

Neredbojias

With neither quill nor qualm, Travis Newbury quothed
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.
 
N

Neredbojias

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.
 
T

Travis Newbury

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.
 
T

Thomas 'PointedEars' Lahn

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


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
 
T

Thomas 'PointedEars' Lahn

Travis said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top