We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

pufftenticle on 04/04/08


Tagged

year date auto footer


Versions (?)


Who likes this?

3 people have marked this snippet as a favorite

SpinZ
blackabee
redhood


Auto Date for Footer


Published in: JavaScript 


URL: http://snipplr.com/view/1394/automatic-date-for-footer/

i found this snippet here on snipplr (see the link up above), and really liked it. it came up with a validation error under XHTML 1.0 Strict so i changed it to what you see in the bottom.....

  1. &copy; **PUT YEAR HERE** <script type="text/javascript">
  2. var d=new Date();
  3. yr=d.getFullYear();
  4. if (yr!=2002)
  5. document.write("-"+yr);
  6. </script>

Report this snippet 

Comments

RSS Icon Subscribe to comments
Posted By: osdesk on April 19, 2008

Useful, but you need a semicolon in line 4

You need to login to post a comment.