Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-17-2003, 08:33 AM   PM User | #1
JavaRookie
New to the CF scene

 
Join Date: Oct 2002
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
JavaRookie is an unknown quantity at this point
How can I create a Popup which only starts the first time you visit my site?

Dear Pro's

I've got a new address and want the visitors of my site to get a popup in which I bring them this news. I know how to create a popup, but I don't want a popup the second time they visit my site. I know this has something to do with cookies, but I have never worked with cookies before. Is there a script for this?

Greetings JavaRookie
JavaRookie is offline   Reply With Quote
Old 01-17-2003, 01:39 PM   PM User | #2
chrismiceli
Regular Coder

 
Join Date: Sep 2002
Location: Louisiana
Posts: 576
Thanks: 0
Thanked 0 Times in 0 Posts
chrismiceli is an unknown quantity at this point
try this:
Code:
function onePop() {
cook = unescape(document.cookie);
cook = cook.indexOf("=");
if(cook.length != 0 && cook[1]!=1) {
//popup code
document.cookie=escape(cookiecount=1);
}
}
__________________
DevEdge - MSDN - DevGuru
chrismiceli is offline   Reply With Quote
Old 01-17-2003, 03:00 PM   PM User | #3
requestcode
Regular Coder

 
Join Date: Jun 2002
Posts: 626
Thanks: 0
Thanked 0 Times in 0 Posts
requestcode is an unknown quantity at this point
Check out this script in the Free Scripts section:
http://www.javascriptkit.com/script/cut65.shtml

It uses onUnLoad in the body tag to popup a window, but you could change that to onLoad.
requestcode is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:20 PM.


Advertisement
Log in to turn off these ads.