這是我的腳本:的ReferenceError沒有定義
<script>
document.addEventListener("DOMContentLoaded", function(event) {
var START_DATE_1 = new Date("July 18, 2016 10:30:00"); // put in the starting date here
var INTERVAL_1 = 3; // in seconds
var INCREMENT_1 = 1; // increase per tick
var START_VALUE_1 = 0; // initial value when it's the start date
var count_1 = 0;
var msInterval_1 = INTERVAL_1 * 1000;
var now_1 = new Date();
count_1 = parseInt((now_1 - START_DATE_1)/msInterval_1) * INCREMENT_1 + START_VALUE_1;
document.getElementById('counter_1').innerHTML = count_1;
setInterval("count_1 += INCREMENT_1; document.getElementById('counter_1').innerHTML = count_1;", msInterval_1);
});
</script>
我把它放在一個Joomla模塊內部。 Firebug說:「ReferenceError:count_1未定義」
爲什麼?我該如何解決它?
謝謝Gothdo,工作!你是否還請幫助我使用千位分隔符來呈現櫃檯的數字(例如3.234.000)? – Francesco
@Francesco你應該問這是一個新的問題。評論不適合擴展討論。 –