As promised, here is a JavaScript code snippet which adds an automatically updating copyright date to your pages. For the PHP version of this code, see the code snippet in our article from yesterday.
The good thing about this code snippet is that it will work in any web page in which it is placed, whereas the PHP code only works in PHP pages.
To make it work, simply add the following code to your page.
<script type="text/javascript">
now=new Date();
year=1+now.getFullYear();
</script>© Copyright 2007-<script type="text/javascript">
document.write(year);
</script>
Be sure to update the start date so that it accurately reflects your copyright.
What will it look like? Well, in 2009, the code would output something that looks like this:
© Copyright 2007-2011
Source By : velvetblues.com
No comments:
Post a Comment