Need a really simple lightweight javascript clock.

Associate
Joined
23 Oct 2004
Posts
2,441
Location
Brighton
Howdy,

I need a really lightweight javascript clock. When I say lightweight I mean that I have to squeeze it into 1500 bytes (ie one full TCP/IP packet).

I need to display the time on a page refresh. This is stored on an embedded webserver chip, so I really don't need layers, divs and all that stuff.

Anyone got any code, Google just seems to pop up bloated scripts.

Cheers.
 
Edt, never mind I figured it out.

plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<SCRIPT>document.write(Date()+'.')</SCRIPT>"));
 
Why not just use php?

something like <?php echo date('d m y'); ?> or whatever? a lot more flexible :)
 
Why not just use php?

something like <?php echo date('d m y'); ?> or whatever? a lot more flexible :)

I don't think many embedded chips are capable of running a lamp stack.

Can't you just cheat and adjust the mtu to more than 1500? :P
 
Last edited:
Back
Top Bottom