SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Jan 23, 2001, 07:02 #1
- Join Date
- Aug 2000
- Location
- Manchester, UK
- Posts
- 1,046
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hello people!
Here's the deal. I'm wanting to add a pop-up window to my site advertising my newsletter and giving visitors the option to sign up to it. Getting the pop-up window to work is no problem and I can do that.
The thing is, having a pop-up window appear everything to visit a site is going to be annoying, so what I want this window to do is set a cookie on the user's machine saying that they've seen this pop-up window.
Then, when the user comes back, the front page will detect the cookie on their machine and not show them the pop up window because they've already seen it and the cookie has been set. Does that make sense?
So I suppose my question is, how do you read and write cookies in JavaScript? I can do the code for the pop-up, and contruct the if statements ok, but i've never had cause to deal with cookies before.
Any help and some examples would be greatly appreciated.
Adyv-technologies - Freelance Goodness.
-
Jan 23, 2001, 14:02 #2
- Join Date
- Aug 1999
- Location
- Pittsburgh, PA, USA
- Posts
- 3,910
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Checkout these threads for information on the popup SitePoint uses, which should fit your needs:
- http://www.sitepointforums.com/showt...?threadid=7884
- http://www.sitepointforums.com/showt...?threadid=5516
Hope that helps.
-
Jan 23, 2001, 19:35 #3
- Join Date
- Apr 2000
- Location
- Melbourne, Australia
- Posts
- 2,571
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
And to learn how to read/write cookies in JavaScript, check out my nice tutorial on the subject, Persistent Data without CGI, on the Sausage Island Tutorials page.
Kevin Yank
CTO, sitepoint.com
I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
Baby’s got back—a hard back, that is: The Ultimate CSS Reference
Bookmarks