javascript - $().countdown 不是函数

标签 javascript jquery ajax countdown

我的代码中有这一行

$('#timeLeftDiv').countdown({ until: expires, timezone: 0, serverSync: serverTime, onTick: serverTime, tickInterval: 60 });

它给我这个错误

TypeError: $("#timeLeftDiv").countdown is not a function

timeLeftDiv 的内容以 Ajaxily 方式刷新。这有什么关系吗?

我已经在我的代码中包含了这一行

<script src="/<path>/jquery.countdown.min.js">

我错过了什么?

最佳答案

可能是缺失的 </script>标签。

假设您之前已经包含了 jQuery,请尝试:

<script type="text/javascript" src="/<path>/jquery.countdown.min.js"></script>

关于javascript - $().countdown 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11646370/

相关文章:

javascript - window.location.replace 奇怪的行为

php - Facebook SDK 访问 token 和 ajax

javascript - 在一个函数中使用另一个函数中的变量

php - 如何保存表单中的信息?

javascript - 使用 KnockoutJS 的 ClickToEdit 按钮

javascript - 类型错误 : Cannot read property 'username' of undefined from Form Submit

javascript - 悬停多个元素仅影响 1 个项目

javascript - 如何在提示前进行 console.log

php - 同时更新数据库和页面内容

javascript - 页面刷新时未调用 Struts2 操作