Search results for 'newCheck'. 1 post(s) found.

  1. 2007/08/30 New content notifier in Javascript
2007/08/30 08:25

New content notifier in Javascript


Use this Cookie to show your visitors what's new on your Web site since their last visit.

newYou.js
now = new Date
expireDate = new Date
expireDate.setMonth(expireDate.getMonth() 6)
lastVisit = new Date(cookieVal("pageVisit"))
document.Cookie = "pageVisit=" now ";expires="   expireDate.toGMTString()

function cookieVal(CookieName) {
  thisCookie = document.Cookie.split("; ")
    for (i=0; i<thisCookie.length; i  ) {
      if (CookieName == thisCookie[i].split("=")[0]) {
        return thisCookie[i].split("=")[1]
      }
    }
  return "1 January 1970"
}

function newCheck(yyy,mm,dd) {
  lastChgd = new Date(yyy,mm-1,dd)
  if (lastChgd.getTime() > lastVisit.getTime()) {
    document.write("<img src='/img/new-to-you/new.gif' alt='new'>")
  }
}


test.html
<html>
<head>
  <title>kurapa.com test</title>
  <script type="text/javascript" src="newYou.js"></script>
</head>
<body>
<script type="text/javascript" language="JavaScript"> newCheck(2005,2,11)</script> Be sure to check out our new scripts!
<br>
<script type="text/javascript" language="JavaScript"> newCheck(2005,2,3)</script> Have you seen our Tutorials?
</body>
</html>

Trackback 3 Comment 0

Trackback : Cannot send a trackbact to this post.

  1. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 00:01 delete

    moneyideas

  2. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 08:23 delete

    moneyideas

  3. Subject different money making ideas

    Tracked from moneyideas 2010/01/31 16:44 delete

    moneyideas