0
這是我廢棄togheter腳本,它只是一個基本的停止時間觀察腳本,我想要一些輸入如何添加簡歷和開始按鈕。而且我希望能夠在它停止時暫停時發送ajax調用。開始停止恢復阿賈克斯
var timer;
$(function() {
$('#dateTime').html(getDateTime());
timer = setTimeout(function() {
update();
}, 1000);
$('#btn').click(function() {
clearTimeout(timer);
var currentdatetime = getDateTime();
});
});
function update() {
$('#dateTime').html(getDateTime());
timer = setTimeout(function() {
update();
}, 1000);
}
function getDateTime() {
var currentdate = new Date();
var datetime = "Timer: " + currentdate.getDate() + "/" + (currentdate.getMonth() + 1) + "/" + currentdate.getFullYear() + " " + currentdate.getHours() + ":" + currentdate.getMinutes() + ":" + currentdate.getSeconds();
return datetime;
}