Top.Mail.Ru
? ?
Javascript's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Tuesday, November 22nd, 2005

Time Event
2:00p
Someone help out a newbie???
Why does this:

date = new Date();
year = date.getFullYear();
document.write(date);
document.write("
");
document.write(year);

work outside of a function, but not inside a function?

The date = new Date(); works in both cases (I can document.write(date)). Outside of the function, I can document.write(year), but not inside the function.

full codeCollapse )

This is (if it's not obvious) for a digital clock to appear on the page with the client-side time. Ultimately, I want to get it updating "live". I've been told I need to use setTimeout("wc()", 1000) to get it to update every second.
2:25p
Dynamocally counting characters
I have a text field
Image

That I want to dynamically update the character count as the user types. Right now, I am using onChange, but that seems to work only when the user clicks out of the box.

Any help is appreciated.
2:40p
collapsible content
I'm a newbie trying to make a very simple collapsible content script. It doesn't work. Could someone please, please help?

Code, but not very much, I swearCollapse )

Thanks in advance.

<< Previous Day 2005/11/22
[Calendar]
Next Day >>
About LiveJournal.com
Image