Simple client side javascript clock

I am playing around with javascript and want to figure out how to embed
it into my rails app. I would like to put a simple 1 sec. time counter
on the web page using javascript.

Can anyone point me in the direction of getting a simple javascript
going from my rails app. Any sample code out there?

I figured I need to have put a clock.js javascript file in the
public/javascript directory. and reference the file through

<%= javascript_include_tag “clock” %>

in my layout file. The clock has a javascript function to update a field
on a periodic basis using setTimeout(“countUp()”, 1000);



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs