Forum Moderators: open
I decided using Javascript and a call date function would work best, but I can't get it to work. This is what I have:
In the html page where I want the footer:
<script language="javascript" type="text/javascript" src="scripts/footer.js"></script>
In the footer.js page:
year=getYear();
document.write("Copyright ©" + year + "All Rights Reserved");
Can someone please help? Thanks.
Try something like this:
var d = new Date();
document.write("Copyright © " + d.getFullYear() + " All Rights Reserved");
You must instantiate the date object to use its methods. getFullYear gives you 4 digit year instead of the 2 digit getYear method.
Here is somemore info on it:
[w3schools.com...]