0
在我移動到RoR之前,我使用了這個很棒的jQuery countdown,它工作正常。 我嘗試在我的Rails(4.0.8)應用程序中再次使用它,但我無法確定爲什麼沒有顯示任何內容。Ruby on Rails - jQuery.countdown沒有顯示
我在app /資產/ JavaScript的(其中包括):
application.js
jquery.countdown.min.js
jquery-2.1.1.min.js
在我的application.js:
//= require_tree .
//= require jquery-2.1.1.min
//= require jquery.countdown.min
在我的Gemfile:
gem 'jquery-rails', '3.0.4'
在我app/views/pages/page.html.erb:
<br />
--
<div data-countdown="2016/01/01"></div>
--
<script type="text/javascript">
$('[data-countdown]').each(function() {
var $this = $(this), finalDate = $(this).data('countdown');
$this.countdown(finalDate, function(event) {
$this.html(event.strftime('%D days %H:%M:%S'));
});
});
</script>
像documented on this page但沒有任何顯示。
我失去了一些東西明顯?謝謝你的幫助。