Open a new window on exit

liunx

Guest
Hi All,<br />
<br />
Can anyone here tell me how to open a new window and display a different URL when a visitor leave the original webpage?<br />
I am trying to open a opt-in form when a visitor to my page diside to exit.<br />
<br />
Thank you for in advance<br />
<br />
BJ<!--content-->have found one before on this site cant find it now but it is there<br />
<br />
<!-- m --><a class="postlink" href="http://javascript.internet.com/">http://javascript.internet.com/</a><!-- m --><!--content-->This should work:<br />
<br />
<body onunload="window.open('http://www.w3.org/')"><!--content-->oi! dont do all the work for em lol :p<!--content-->There's two ways of learning:<br />
<br />
1) Pointing someone in the right direction, (like you did), so that they spend quite some time scratching around until they find what they want.<br />
<br />
2) Give them the answer straight away, (like I did), so that they don't have to spend a lot of time looking for it. This way also keeps them coming back for more help, and one little bit at a time they add to their knowledge of JavaScript.<br />
<br />
At least that's the way I see it.<!--content-->well it depends on what type of mood im in to what i tell em, today=bad day, but if they search around like i told him to do (sort of) he may find other scripts that he liks<!--content-->With me, it doesn't matter what mood I'm in, even when I'm in a bad mood I'll still try and help to the best of my ability. It all depends on whether I can be arsed to help. Today I'm in a bad mood and I can't be arsed, (oh dear).<br />
<br />
I was in a school badmiton match and lost 3/3 games, and I'm supposed to be the best one there. I'm absolutely shattered. Eveyrone else at our school lost their games as well though so that makes me feel a bit better.<!--content-->thats like me on the day i posted that note saying see this site find it on there, i play hl counterstrike and i am very good at it, usually killing bout 15 people only dying 2 or 3 times, that day i couldnt kill no one only got 1 kill and 8 deaths average per game, got my skill back now tho :D<!--content-->I am so good at UT 2003, but I've only got a 56 Kb modem. You won't believe how bad it is to play online with that slow a connection. My ping time, (if I'm lucky), is 250. I fire my weapon and it fires about half a second later. How crap is that???<!--content-->0.5sec thats bad i got 512k and my ping is about 50 on all games, havnt played ut 2k3 my computer wont run it lol, theres you with a good comp and a slow connection, me with a slow comp and a good connection lol, ever played cs?<!--content-->I haven't got that good a PC, I can't run the game with all of the graphics options on full, half of them have to be on just less than full.<br />
<br />
It's going on 2 years out of date now:<br />
<br />
Athlon MP 1800+<br />
Ge-Force 3<br />
512Mb RAM<br />
only 40Gb HDD<br />
<br />
No, by the way I haven't played Counter-Strike although I know some people at school that do.<br />
<br />
How I would love to blow ?000 at Alienware (<!-- m --><a class="postlink" href="http://www.alienware.co.uk/">http://www.alienware.co.uk/</a><!-- m -->)!!!<!--content-->nice how i would to you ever thought about playing cs, im gonna try and pick up a copy of ut 2k3 ive just made a clan for cs called .iR. Insane Reactions<!--content-->Well, that all depends. It has to be a good game in single player mode, and it also depends on whether Game still sell it.<br />
<br />
But if I see it then I might buy it.<!--content-->yeah game still sell it you can get half life generations 4 games in one for ?3, thats hlaf life, counterstrike, opposing force and blueshift<!--content-->I'll have a look for it next weekend when I go.<br />
<br />
By the way I hope that bhatijay's question has been answered.<!--content-->oh yeah lol forgot about that, yeah good luck with that bhatijay<!--content-->These guys are such nerds... :D Kidding...<br />
<br />
If you want a customised window e.g with no status bars etc..<br />
<br />
PUT IN HEAD TAG<br />
<br />
<SCRIPT LANGUAGE="JavaScript"><br />
function flyUP(URL) {<br />
day = new Date();<br />
id = day.getTime();<br />
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=700,height=500,left = 0,top = 0');");<br />
}<br />
</script><br />
<br />
THEN USE THIS AS BODY TAG<br />
<br />
<body onunload="javascript:flyUP('http://www.somewhere.com')"<br />
<br />
<br />
P.s. I didn't steal this one Pyro!! :p<!--content-->If you want to open a new winow that looks jut like a normal window then you could do this:<br />
<br />
<body onunload="document.a_form.submit();"><br />
<br />
<form target="_blank" name="a_form" action="page.html" method="post"></form><br />
<br />
Then when the window is closed it will submit the form and open a new window.<!--content-->
 
Back
Top