Have you ever given your websites a once over and all of a sudden noticed your footer has a copyright 1996 All Rights Reserved? Ack, what if you have 20 or 30 web sites? Do You have to go through each one and update the footer every year?
Try this
Copyright © 2008
<script language="JavaScript">
var d=new Date();
yr=d.getFullYear();
if (yr!=2008)
document.write("- "+yr);
</script>
This little JavaScript reads the year on the user’s computer and displays it in your footer. You never have to update the Copyright statement again.
Actually, in the script above, we have this years date (or the year of conception), followed by the script which first checks the system date and compares it to this years date, 2008. If it is still 2008 nothing is written. If it is not 2008 a dash and the current year is written. So, next year, 2009, the above footer text will read “Copyright © 2008 – 2009″. No manual updating.
December 12th, 2009 at 1:15 pm
Is there a way to open the link in a new window ?
December 12th, 2009 at 1:24 pm
What link? There is no link in this script.
However, if there were a link and you wanted it to open a new browser window all you would need to do is add target=”_blank” to the href tag.