$("#footer").append("<p>© 2011</p>");
Is there a way to make the year update on its own开发者_开发技巧?
Why don't you use php instead ? Stick some php code that retrieves the current year in your paragraph tag and you're done ;)
var today = new Date;
var year = today.getFullYear();
$("#footer").append("<p>© "+ year + "</p>");
try:
$("#footer").append( "<p>© " + (new Date).getFullYear() + "</p>");
$("#footer").append( "<p>© " + (new Date).getFullYear() + "</p>");
$("#footer").append( "<p>© " + (new Date).getFullYear() + "</p>");
This may work:
var d=new Date();
$("#footer").append("<p>© "+ d.getFullYear() +"</p>");
精彩评论