sircharlo Posted October 11, 2007 Share Posted October 11, 2007 Hey guys,I would like to do a simple copyright notice at the bottom of my page, using the copyright symbol and year, like this: Copyright © 2007 by Twit IndustriesInstead of having to update my pages every year, isn't there a simple way to display the current year in JS ?Thank you very much !P.S. Up to yesterday, I never did a thing in JS without a generator, so I would need really easy instructions, or cut-paste stuff. Thank you !Also, since I am going to be using the same script on every page, is there a way to link to an external .JS file (like CSS) ? Link to comment Share on other sites More sharing options...
justsomeguy Posted October 11, 2007 Share Posted October 11, 2007 var dateObj = new Date();var year = dateObj.getFullYear();You can use a src attribute with a script tag to point to a file, check the reference for the script tag. Link to comment Share on other sites More sharing options...
Synook Posted October 12, 2007 Share Posted October 12, 2007 Some "cut & paste" code Copyright © <script type="text/javascript">var dateObj = new Date();var year = dateObj.getFullYear();document.write(year);</script> by Twit Industries Link to comment Share on other sites More sharing options...
sircharlo Posted October 12, 2007 Author Share Posted October 12, 2007 Thanks !P.S. Would an other scirpting method be better (VBScript, other ?) Link to comment Share on other sites More sharing options...
jesh Posted October 12, 2007 Share Posted October 12, 2007 If you are doing this on the client-side, then the only viable solution, really, is javascript. VBScript only works on IE. I suppose you could use Flash, but that seems like a lot of wasted development and overhead just to show the year on the screen. Link to comment Share on other sites More sharing options...
sircharlo Posted October 12, 2007 Author Share Posted October 12, 2007 Yeah, true. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.