Automatic Copyright Date Update With JavaScript

February 23, 2009 in Code Library | Comments (0)

Need something that auto updates your copyright date?

the code:


Copyright © 2001
<script type="text/javascript">
<!-- Begin Date Script
copyright=new Date();
update=copyright.getFullYear();
document.write("-" + update);
//  End -->
</script>
 All rights reserved.

Paste this into the bottom of your page in a footer, and you’ll never have to update your copyright information again. Notice how I have worded the beginning date. This way, if there is an error with their javascript, they still get the message.