SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
-
Jan 14, 2001, 08:12 #1
- Join Date
- Jul 2000
- Location
- 13 miles off the French Coast
- Posts
- 92
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi all. I can find plenty of popup window code examples but I want one which works the same way the sitepoint code does and pops up a window to ask if the user wants to subcsribe to our newsletter for the first time they visit and then does not reappear each time they visit, I assume tghis uses a cookie. Maybe Sitepoint could point me in the right direction.
Thank you one and all
Regards AndyD.
-
Jan 17, 2001, 13:09 #2
- Join Date
- Nov 2000
- Location
- A home in the hills where the grass grows green an
- Posts
- 183
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Here is a very simple popup window maker.
This goes in the head of the document:
Code:<script language="JavaScript" type="text/javascript"> <!-- Begin function popUp(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,location=1,statusbar=1,menubar=1,resizable=1,width=400,height=300');"); } // End --> </script>
Your links should look like this:
Code:<A HREF="javascript:popUp('url_you_want_to_open')">Open the Popup Window</A>
-
Jan 17, 2001, 13:10 #3
- Join Date
- Nov 2000
- Location
- A home in the hills where the grass grows green an
- Posts
- 183
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
And the little smiley face is a capitol "P"...lol
-
Jan 17, 2001, 15:18 #4
- Join Date
- Aug 1999
- Location
- Pittsburgh, PA, USA
- Posts
- 3,910
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
cckrocks: you can go edit your post, and check a box just above the Submit button to Disable all smilie faces - that ought to fight the little guy with his tongue sticking out in the middle of your code.
AndyD: Checkout these threads...
- http://www.sitepointforums.com/showt...?threadid=7884
- http://www.sitepointforums.com/showt...?threadid=5516
Hope that helps!
-
Jan 17, 2001, 16:17 #5
- Join Date
- Nov 2000
- Location
- A home in the hills where the grass grows green an
- Posts
- 183
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yeah I know....thanks.
-
Jan 24, 2001, 19:48 #6
How would I use this with PHP? I am trying to take url's out of a MySQL database with the name $url. How do I open this url up using the above script or any other?
Thanks,
-JRW
-
Jan 24, 2001, 20:08 #7
- Join Date
- Apr 2000
- Location
- Melbourne, Australia
- Posts
- 2,571
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Just write the link dynamically in PHP, slotting in your PHP variable where the URL belongs:
Code:<A HREF="javascript:popUp('<?=$url?>')">Open the Popup Window</A>
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