javascript - jQuery - countTo 插件在本地工作,但不在服务器上
问题描述
我的以下代码在本地工作得很好,但是当上传到共享主机时,它会在一些随机数上停止。
单击“重新启动”按钮可以正常工作。但我希望在页面加载时第一次运行计数。
这是托管我的代码的链接: https ://spoose.com/others/test/
插件代码链接: https ://spoose.com/others/test/countto.js
$(function() {
let the_timer = $('.timer').countTo();
$('#restart').on('click', function() {
the_timer.countTo('restart');
});
});
<p class="timer" data-from="0" data-to="10000" data-speed="10000" data-refresh-interval="50"></p>
<button id="restart">restart</button>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://spoose.com/others/test/countto.js"></script>
解决方案
推荐阅读
- python - 有没有办法更改在 Python 中使用 zipfile 提取的文件的名称?
- android - Flutter 本地通知 NullPointerException:尝试在空对象引用上调用虚拟方法“setAction(java.lang.String)”
- reactjs - 如何使用 frontend-maven-plugin 从捆绑到 Spring Boot 的 React 应用程序进行 REST api 调用?
- python - 是否可以查看掩码语言建模的所有令牌排名?
- python - 我是否需要 Tensorflow 对象检测 API 才能使用我在另一台计算机上制作的训练模型?
- python - 如何运行用 python 编写的 Cypress 测试用例?
- php - 如何更改类变量并保存此变量
- python - 从多维数组矢量化采样
- layout - 给定容器大小和项目固定纵横比的计算网格布局的算法
- python - Python - Pip 安装到未安装 Python 的目录中