Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Community Forums
 Community Discussions (All other subjects)
 JavaScript question

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
borge Posted - 04 May 2008 : 05:53:06
I have been using a small JavaScript to display the current year. It is working well with IE, but I recently discovered that it is not displaying right in Mozilla Firefox.

<SCRIPT language="JavaScript">
<!-- 
var today_date= new Date()
var myyear=today_date.getYear()
document.write(myyear)
--> 
</script>


Does anyone know what I should so to fix it, or a better way of accomplishing what this script is supposed to do?<
3   L A T E S T    R E P L I E S    (Newest First)
phy1729 Posted - 04 May 2008 : 15:30:11
You're welcome.<
borge Posted - 04 May 2008 : 14:47:47
Thanks, that fixed it <
phy1729 Posted - 04 May 2008 : 10:51:01
That works fine for me in FF 2.0.0.14 but you may want getFullYear() which will return 2008 not 108 and comment out the --> by using //-->. If you're using a xhtml doctype get rid of the comment altogether because anything in a comment can be ignored by a parser.<

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000 Version 3.4.07