HighDots Forums  

Java Script help with copyright and last updated dates

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Java Script help with copyright and last updated dates in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
CrimeDoctor
 
Posts: n/a

Default Java Script help with copyright and last updated dates - 05-16-2005 , 11:48 AM






My website http://www.crimedoctor.com has Java Scripts at the very bottom of
the page for updating the copyright year and page last updated date. It
displays the year perfectly in IE 6.0 as ?5/16/2005?

However, in Netscape and Firefox the Java Script displays the year as
?5/16/105?

Can anyone advise me how to fix this code?I can?t see the error?

Here is the Java Script code:

<script type="text/javascript"></script>
<script type="text/javascript">function todayStr() {
var today=new Date()
return today.getMonth()+"/"+today.getDate()+"/"+(today.getYear())
}
function yearStr() {
var today=new Date()
return today.getYear()
}
</script>
Copyright &copy; 1996-
<script type="text/javascript">document.write(yearStr())</script>
- Aegis Books, Inc. - All Rights Reserved - <br>
Page Last Updated -
<script type="text/javascript">document.write(todayStr())</script>



Reply With Quote
  #2  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Java Script help with copyright and last updated dates - 05-16-2005 , 12:05 PM






Ew. Sorry about that!

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"CrimeDoctor" <chris (AT) crimedoctor (DOT) com> wrote

Quote:
My website http://www.crimedoctor.com has Java Scripts at the very bottom
of
the page for updating the copyright year and page last updated date. It
displays the year perfectly in IE 6.0 as ?5/16/2005?

However, in Netscape and Firefox the Java Script displays the year as
?5/16/105?

Can anyone advise me how to fix this code?I can?t see the error?

Here is the Java Script code:

script type="text/javascript"></script
script type="text/javascript">function todayStr() {
var today=new Date()
return today.getMonth()+"/"+today.getDate()+"/"+(today.getYear())
}
function yearStr() {
var today=new Date()
return today.getYear()
}
/script
Copyright &copy; 1996-
script type="text/javascript">document.write(yearStr())</script
- Aegis Books, Inc. - All Rights Reserved - <br
Page Last Updated -
script type="text/javascript">document.write(todayStr())</script





Reply With Quote
  #3  
Old   
darrel
 
Posts: n/a

Default Re: Java Script help with copyright and last updated dates - 05-16-2005 , 12:23 PM



Quote:
Copyright &copy; 1996-
script type="text/javascript">document.write(yearStr())</script
- Aegis Books, Inc. - All Rights Reserved - <br
Page Last Updated -
script
type="text/javascript">document.write(todayStr())</script

I'd suggest not using javascript for the copyright date, since that only
needs updating once a year, a SSI might make more sense.

Also, the javascript 'last updated' is pointless, since it doesn't have
anything to do with when the page was actually last updated, so I'd just get
rid of that.

-Darrel




Reply With Quote
  #4  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Java Script help with copyright and last updated dates - 05-16-2005 , 12:28 PM



Quote:
I'd suggest not using javascript for the copyright date, since that only
needs updating once a year, a SSI might make more sense.
Say what?

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"darrel" <notreal (AT) hotmail (DOT) com> wrote

Quote:
Copyright &copy; 1996-
script
type="text/javascript">document.write(yearStr())</script
- Aegis Books, Inc. - All Rights Reserved - <br
Page Last Updated -
script
type="text/javascript">document.write(todayStr())</script

I'd suggest not using javascript for the copyright date, since that only
needs updating once a year, a SSI might make more sense.

Also, the javascript 'last updated' is pointless, since it doesn't have
anything to do with when the page was actually last updated, so I'd just
get
rid of that.

-Darrel





Reply With Quote
  #5  
Old   
darrel
 
Posts: n/a

Default Re: Java Script help with copyright and last updated dates - 05-16-2005 , 12:28 PM



Quote:
Say what?
What.

-Darrel




Reply With Quote
  #6  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Java Script help with copyright and last updated dates - 05-16-2005 , 12:28 PM



Oh. <shrug>. I'd rather not have to think about it at all.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"darrel" <notreal (AT) hotmail (DOT) com> wrote

Quote:
Copyright &copy; 1996-
script
type="text/javascript">document.write(yearStr())</script
- Aegis Books, Inc. - All Rights Reserved - <br
Page Last Updated -
script
type="text/javascript">document.write(todayStr())</script

I'd suggest not using javascript for the copyright date, since that only
needs updating once a year, a SSI might make more sense.

Also, the javascript 'last updated' is pointless, since it doesn't have
anything to do with when the page was actually last updated, so I'd just
get
rid of that.

-Darrel





Reply With Quote
  #7  
Old   
James Shook
 
Posts: n/a

Default Re: Java Script help with copyright and last updated dates - 05-16-2005 , 01:41 PM



I think what Murray was fazed by is the notion that you have to update
copyright notices "once a year." The copyright year is the year in which
the work was created. If that was 1999, the the copyright will be 1999,
no matter what the year is now. So updating copyright notices to the
current year is pointless and may actually invalidate them.

--
James M. Shook
http://www.jshook.com

Reply With Quote
  #8  
Old   
Chuck
 
Posts: n/a

Default Re: Java Script help with copyright and last updated dates - 05-16-2005 , 01:42 PM



Use getFullYear instead of getYear



Reply With Quote
  #9  
Old   
darrel
 
Posts: n/a

Default Re: Java Script help with copyright and last updated dates - 05-16-2005 , 01:44 PM



Quote:
I think what Murray was fazed by is the notion that you have to update
copyright notices "once a year." The copyright year is the year in which
the work was created. If that was 1999, the the copyright will be 1999,
no matter what the year is now. So updating copyright notices to the
current year is pointless and may actually invalidate them.
Typically, one simply puts a blanket copyright on the contents of a web
site:

Web site copyrighted 1998-2005

etc...

-Darrel




Reply With Quote
  #10  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Java Script help with copyright and last updated dates - 05-16-2005 , 01:46 PM



No - actually, I was fazed by the notion that I had to DO SOMETHING other
than upload and forget. I don't think that updating the year impacts your
copyright. Do you have an indication that it might?

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"James Shook" <jshook (AT) dont_mail (DOT) com> wrote

Quote:
I think what Murray was fazed by is the notion that you have to update
copyright notices "once a year." The copyright year is the year in which
the work was created. If that was 1999, the the copyright will be 1999, no
matter what the year is now. So updating copyright notices to the current
year is pointless and may actually invalidate them.

--
James M. Shook
http://www.jshook.com



Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.