jquery刷新插件

发布于 2024-12-12 18:59:27 字数 674 浏览 2 评论 0原文

嗨,我有这个脚本 http://jsbin.com/ajaneh ,当我执行操作时抛出 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});
             }

});

插件不是刷新,我需要从 php 添加 stopTimer : false ,但计时器没有反应,我想我必须刷新插件,但是如何?谢谢 !!!!

更新

感谢您的帮助,我为我的错误提供了资金,stopTimer : false 的值不是布尔值,我添加了检查 if (settings.stopTimer != = 'true') ,现在可以了

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

停顿的约定 2024-12-19 18:59:27

你的意思是像 clearTimeout(timer);

if (!settings.stopTimer) {
    timer = setInterval(do_time, 1000);
} else {
    clearTimeout(timer);
}

you mean something like clearTimeout(timer);

if (!settings.stopTimer) {
    timer = setInterval(do_time, 1000);
} else {
    clearTimeout(timer);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文