Hi i have this script http://jsbin.com/ajaneh , when i make an action throw ajax
$.ajax({
type: "POST",
url: domain+"/home/register_working_time/",
dataType: 'json',
data: data,
success: function(dt){
$("#work_time").timer({time:dt.timerTime, stopTimer : dt.stopTimer});
}
});
plugin is not refreshing , i need to add stopTimer : false
from php , but no reaction from timer , i think i have to refresh plugin , but how ? thank you !!!!
Update
Thank you for helping , i funded my mistake , value for stopTimer : false
, was not boolean , and i added to check if (settings.stopTimer !== 'true')
, and now it works
you mean something like clearTimeout(timer);
if (!settings.stopTimer) {
timer = setInterval(do_time, 1000);
} else {
clearTimeout(timer);
}