General
This unobtrusive script will update the current year for the copyright notice on a page. No need to worry about changing it from year to year. Very easy to implement.
Copyright © 2002-… by Acme Corporation. All rights reserved
Notes
- Created by: Spike McLarty
- Web Site: http://www.dosadi.com/
- Posted: September 26, 2008
Source Code
Paste this source code into the designated areas.
External file
Paste this code into an external JavaScript file named: copyNote.js
/* This script and many more are available free online at
The JavaScript Source!! http://javascriptsource.com
Created by: Spike McLarty | http://www.dosadi.com/ */
function copyDate() {
var cpyrt = document.getElementById(“copyright”)
if (cpyrt) {
cpyrt.firstChild.nodeValue = (new Date()).getFullYear();
}
}
window.onload = copyDate;
Head
Paste this code into the HEAD
section of your HTML document.
<script type=”text/javascript” src=”copyNote.js”></script>
Body
Paste this code into the BODY
section of your HTML document.
Copyright © 2002-<span id=”copyright”>…</span> by Acme Corporation. All rights reserved