• Page 1 of 1
  • 1
Pop up window.
KatrinL
Posts: 20
Reputation: 0

Message # 1 | 4:31 AM
I hope moderators won't hate me for being so annoying, but i have a question. How do i create a pop up window that appears when somebody is leaving my site? I found this info (posted by Sunny):

Code
<a href="javascript://" onclick="new _uWnd('myName','Window title',500,200,{autosize:1,maxh:300,minh:100},'Here goes window content');">Click me</a>

We need the following part which is the code of an Ajax window itself:
Code
new _uWnd('myName','Window title',500,200,{autosize:1,maxh:300,minh:100},''Here goes window content');

where:
myName – is a unique name of a window. This text is displayed nowhere but is used to work with such windows;

Window title – is a title that is displayed at the top of an Ajax window;

500 – width;

200 – height;

Here goes window content- is content of a window. Here HTML codes can be used.
___________________________________________________________________________

Ok. this is a code for a blue pop up window. It will appear as a link on the page, but it it possible to have this window pop up when the visitor leaves my site?

CodeResolution
Posts: 1570
Reputation: 58

Message # 2 | 7:50 AM
You can use basic internet pop-up windows, but I'm not so sure about loading the Ajax Window on an unload function (leaving the page). Here is the basic HTML script, replace the body tag with the following:
Code
<body onunload="alert('Are you sure you want to navigate away from this page?')">

You can change the Are you sure you want to navigate away from this page? text to what you want.


Kind regards,
Elliott.

"The best uCoz" critic since 2007.
Qualified website, branding, print & user interface designer.

I'm on Behance and Twitter.
Natashko
Posts: 3366
Reputation: 171

Message # 3 | 10:04 AM
KatrinL, it can be done. But it involves a lot of coding and a good knowledge of JScritps. Unfortunately, I can't help you with this. But I will move the thread to Users Communication. Maybe, you can get some help there.
KatrinL
Posts: 20
Reputation: 0

Message # 4 | 3:24 PM
CreativeCollusions, that's exactly what i'm looking for, BUT... is it possible to have one of my polls displayed in that window? I tried just to create a poll and then replace"Are you sure you want to navigate away from this page?" with $POLLC_3$ ...didn't work. I just want people to be able to answer 1 question before they leave my site.
I would really appreciate your help : )
CoffeeCone
Posts: 687
Reputation: 41

Message # 5 | 2:50 AM
KatrinL, an alternative you can do is ask the user if he / she wants to answer your poll. Then if the user agrees, take them to a seperate page that contains your poll. As far as I know, JavaScript alert(); windows can't carry HTML in it. Just plain text.
"Friends don't let friends use Internet Explorer 6." - Microsoft || Join the cause. Help your friends.


  • Page 1 of 1
  • 1
Search: