...

View Full Version : How can I create a Popup which only starts the first time you visit my site?



JavaRookie
01-17-2003, 08:33 AM
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

chrismiceli
01-17-2003, 01:39 PM
try this:


function onePop() {
cook = unescape(document.cookie);
cook = cook.indexOf("=");
if(cook.length != 0 && cook[1]!=1) {
//popup code
document.cookie=escape(cookiecount=1);
}
}

requestcode
01-17-2003, 03:00 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum