Navigation Menu

Site Contents
What's New?


Site FAQ
About JSS
JavaScript Forum
JavaScript Tutorial
Friends of JSS

Link to Us
JavaScript Help
Contribute a script
Technology Jobs

Become a Partner

Internet.commerce

Be a Commerce Partner














Internet.com

IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Developer Channel

FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

Great Sites

DocJavaScript.com
dhtml.com
The Freebie Directory
TheFreeSite.com

Browse Doc JS's Tips!


Hiermenus Central


Promotions

Free Announcements


Social Bookmark

General

If you have a popup window which opens on your home page every time a visitor returns, it can become very annoying. Using cookies, this script can determine if the visitor has been here before, and only open a new window on their first visit to the page. The next time they come back, the script will read the cookie, identify them as a repeat visitor, and not open the window again.


[ Reload the page and you'll notice that the popup window doesn't open again. ]

Notes

  • Posted: September 03, 1999

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: onlyPopupOnce.js


Head

Paste this code into the HEAD section of your HTML document.


User Comments

Add a comment, suggestion, or correction
[For questions about usage, consult the Notes tab above or visit the JavaScript forum]

    
   
       
[optional field]
 
[optional field]

   

Comments feed Comment Feed RSS 2.0

8. From: Rosana
12/13/2007 08:56:10

Great

It´s a perfect solution cookie for popups.

Thanks a lot

Rosana

5. From: Zack
I need some help
11/21/2007 14:46:00

Ok, I will sound VERY stupid, but how do I make an external JavaScript file? I have a website provider called Homestead, so I don't normaly use javascript or HTML, It is a drag and drop software. They do let me have a HTML element. Does anyone out there use homestead and know what to do?

7. From: David
RE: I need some help
12/05/2007 14:47:18

Hey Zack,

You can copy and paste the code into Notepad and save as onlyPopupOnce.js. Make sure you add the .js as the exstension.

Then you can upload the file to you site. Can you upload external files with Homestead?

Hope this helps.

David

6. From: Lee (Admin)
12/04/2007 10:39:34

Due to the limitations of these comments, you will need to submit your question to the JavaScript Forum for further help.

3. From: Gene T-Bow
Can you create a script to make page pop-up again?
11/06/2007 17:45:49

The site I'm working with has a page that has a check off box that a visitor can check if they do not want to see that page again. My question is this, Is there a way to "uncheck the box ", because the content has changed. I'm new to this so I'm probally missing something obvious.
Thanks
Gene

4. From: Lee (Admin)
11/13/2007 11:31:40

That really has nothing to do with this script, Gene. You will need to submit your question to the JavaScript Forum for further help.

2. From: Jennie Paulino
02/23/2007 00:48:06

Hi,

I was wondering if you can have Javascript only display a particlar graphic the first time a visitor comes to your site, all subsequent visits getting a different graphic? My site is staging at http://www.jpaulino.com/smc and I want to have the typewriting words only be animated on the first visit, all subsequent visits they'd be static. ANyone know how? THanks!!!!


1. From: emmanuel
11/27/2006 12:48:39

Well, now for testing purposes. i've deleted cookies and temporary files by Tools->Internet Options

but It just appears the popup when the machine is restarted not by deleting the cookies. i supposed that deleting cookies will activate the popup again but not so. Anyone can explain?



Do you write JavaScripts?
If you do, why not submit them to us?
We'll give you credit and a link back to your Web site.