SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot JordanTLClive's Avatar
    Join Date
    Feb 2001
    Location
    Las Vegas, NV
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Popup not displaying:-(

    I read the article on using cookies and javascript to create a ezine popup and tailored it a bit to my preferences. I need a window on my site to popup on the first page load, but only once every 30 minutes. This is the code I have:

    In HEAD
    Code:
    <script language= "JavaScript">
    
    function doPopup(){
    	var ezine = getCookie('popupShown');
    	setCookie('popupShown', 'true', '', '');
    
    	if(ezine == '')  {
    	// Show the popup window
    	window.open('http://www.daveandjordan.com/ads/adcycle.cgi?gid=3&cid=5&mid=6&id=386', 'votepopup', 'width=500,height=400');
    	}
    }
    
    function setCookie(cookieName, cookieValue, cookiePath, cookieExpires) {
    	cookieValue = escape(cookieValue);
    	if (cookieExpires == "")  {
    		cookieExpires = '1800';
    	}
    	if (cookiePath != "")  {
    		cookiePath = ";Path=" + cookiePath;
    	}
    	document.cookie = cookieName + "=" + cookieValue +
    	";expires=" + cookieExpires + cookiePath;
    }
    
    function getCookie(name) {
    	var cookieString = document.cookie;
    	var index = cookieString.indexOf(name + "=");
    
    	if (index == -1) {
    		return null;
    	}
    
    	index = cookieString.indexOf("=", index) + 1;
    	var endstr = cookieString.indexOf(";", index);
    
    	if (endstr == -1) {
    		endstr = cookieString.length;
    	}
    
    	return unescape(cookieString.substring(index, endstr));
    }
    
    </script>
    And my BODY Tag:
    Code:
    <body bgcolor="#172F5E" text="#000000" link="#363636" vlink="#363636" alink="#d5ae83" onLoad="doPopup()">
    Now for some reason, no page ever pops up. Any idea why?

    URL: http://209.51.166.18/

    Any help would be much appreciated!
    -Jordan

  2. #2
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    ... I get a popup every single time
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  3. #3
    SitePoint Zealot JordanTLClive's Avatar
    Join Date
    Feb 2001
    Location
    Las Vegas, NV
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you try again? I had put another popup code on that made it load on every page no matter what for a few moments while someone tested something.
    -Jordan

  4. #4
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    No poppie
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  5. #5
    SitePoint Zealot JordanTLClive's Avatar
    Join Date
    Feb 2001
    Location
    Las Vegas, NV
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone have an idea why???
    -Jordan

  6. #6
    SitePoint Evangelist
    Join Date
    Oct 2001
    Location
    Texas
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i got a popup every time? but i do have the cookie on my machine

    im lost?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •