I need a countdown timer for a rails application I\'m working on so I decided to use this.
http://keith-wood.name/countdown.html
In the public/javascripts folder
Try wrapping
var element = '#countDownTimer';
var year = <%= @deal.end.year %>;
var month = <%= @deal.end.month %>;
var day = <%= @deal.end.day %>;
setCountdownTimer(element, year, month, day);
inside a $(document).ready()
also I don't think this needs to be in the $(document).ready()
function setCountdownTimer(element, year, month, day) {
var date = new Date(year, month, day);
$(element).countdown({until: date});
}
The issue is probably that your calling setCountdownTimer before its defined