Current location: Hot Scripts Forums » General Web Coding » JavaScript » HELP, copyright.js script needs year to automatically change.


HELP, copyright.js script needs year to automatically change.

Reply
  #1 (permalink)  
Old 10-22-09, 10:52 PM
myWebsearch myWebsearch is offline
New Member
 
Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
HELP, copyright.js script needs year to automatically change.

Below is a "copyright.<acronym title="JavaScript">js</acronym>" script that automatically inserted on each site page by this.... <script language="JavaScript" src="copyright.<acronym title="JavaScript">js</acronym></script>
I would like the year 2009 to change automatically on January 1st.

================================================
<!-- Begin

// NOTE: If you use a ' add a slash before it like this \'

document.write('<span class ="copyright">&copy; Copyright 2009 ');

document.write('<a href="index.html" target="_top">Your Company Name</a> ');

document.write('All Rights Reserved<br>');

document.write('For more information feel free to ');

document.write(' <A HREF="contact.htm">Contact Us</a>');

document.write('</span><br>');

// End -->

Last edited by End User; 10-23-09 at 07:06 AM. Reason: Removed acronym tags
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-23-09, 07:09 AM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Untested, but I think this would do it. The new parts are in bold.

var currentTime = new Date()
var year = currentTime.getFullYear()


// NOTE: If you use a ' add a slash before it like this \'

document.write('<span class ="copyright">&copy; Copyright ' + year);

document.write('<a href="index.html" target="_top">Your Company Name</a> ');

document.write('All Rights Reserved<br>');

document.write('For more information feel free to ');

document.write(' <A HREF="contact.htm">Contact Us</a>');

document.write('</span><br>');
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-23-09, 07:12 AM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
Code:
d=new Date();
document.write(d.getFullYear());
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 10-23-09, 11:45 PM
JavaScriptBank JavaScriptBank is offline
New Member
 
Join Date: Jul 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
I think this should be done by server script (PHP,CGI,...) because my clock system is wrong, it'll display year 2374 when I enter your site
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 10-25-09, 12:58 AM
myWebsearch myWebsearch is offline
New Member
 
Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
I just tested the below and it works..... Thanks

<!-- Begin

// NOTE: If you use a ' add a slash before it like this \'

document.write('<span class ="copyright">&copy; Copyright ');

document.write(d.getFullYear());

document.write('<a href="index.html" target="_top"> Your Company Name</a> ');

document.write('All Rights Reserved<br>');

document.write('For more information feel free to ');

document.write(' <A HREF="contact.htm">Contact Us</a>');

document.write('</span><br>');

// End -->
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Your Own Profitable and VERY unique eBusiness Voltaire General Advertisements 3 03-30-10 07:36 AM
Want to change combo box using java script hYph3n JavaScript 3 01-12-07 09:34 AM
Is there any integrity of script rankings? webmaster@atmanager.com Hot Scripts Forum Questions, Suggestions and Feedback 17 08-06-04 01:12 AM
Did PHP complete change over the last year or so? or am i just REALLY stupid now? playtothebeat PHP 2 07-15-03 11:28 PM


All times are GMT -5. The time now is 11:53 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.