SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Freelance Web Designer KeithMcL's Avatar
    Join Date
    Oct 1999
    Location
    Dublin, Ireland
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can someone do me a favour please?

    Hi all,

    I just added a recommend this site script to my other site www.webdevsites.com and would like to know if you will do me a favour and visit that site and then leave again and tell me if a new window pops up asking you if you liked the site and to recommend it to a friend.

    If it does, can you tell me what the window looks like or even take a screen shot and email it to me at kmcluk@aol.com please?

    I can't see if myself when I try. It sets a cookie on the users machine so i've already tried clearing my cookies, but it still hasn't worked.

    Thanking you in advance

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry, i didn't get a pop-up

    i think i did what you were asking correctly

  3. #3
    Freelance Web Designer KeithMcL's Avatar
    Join Date
    Oct 1999
    Location
    Dublin, Ireland
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for doing that for me Kyuss. I'll have to look into it some more.

  4. #4
    Freelance Web Designer KeithMcL's Avatar
    Join Date
    Oct 1999
    Location
    Dublin, Ireland
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The javascript needed to have a window popup when someone leaves your site was posted in this forum before and I thought I saved it, but when I put it on my site it doesn't seem to work.

    Here's the code I saved at the time:
    Code:
    <SCRIPT LANGUAGE="JavaScript">
    function getCookieVal (offset) {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1)
    endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
    }
    function GetCookie (name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
    return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0)break;}
    return null;}function SetCookie (name, value) {
    var argv = SetCookie.arguments;
    var argc = SetCookie.arguments.length;
    var expires = (2 < argc) ? argv[2] : null;
    var path = (3 < argc) ? argv[3] : null;
    var domain = (4 < argc) ? argv[4] : null;
    var secure = (5 < argc) ? argv[5] : false;
    document.cookie = name + "=" + escape (value) +
    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) 
    +((path == null) ? "" : ("; path=" + path)) 
    +((domain == null) ? "" : ("; domain=" + domain)) 
    +((secure == true) ? "; secure" : "");
    }
    function DisplayInfo() {if (!document.layers){
    var expdate = new Date();
    var visit;
    expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365));
    if(!(visit = GetCookie("visit")))visit = 0;
    visit++;SetCookie("visit", visit, expdate, "/", null, false);
    var message;
    if(visit == 1)
    popup()
    }
    }
    function ResetCounts() {
    if (!document.layers){
    var expdate = new Date();
    expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365));
    visit = 0;
    SetCookie("visit", visit, expdate , "/", null, false);
    }
    }
    function popup(){
    window.open('http://www.yourdomain.com/page.html','win1','width=280,height=400,resizable')
    }
    //ResetCounts()
    </script>
    And in the body tag enter onUnload='subPopup();'

    Is this correct? If not, can someone else post the code if they have it please?

    Thanks.


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
  •