Javascript 我想在我的WordPress站点中使用counterup.js,但它显示了错误
我正在使用 js。在普通html中,它工作正常,但当我在WordPress中使用此脚本时,它显示未捕获的TypeError:undefined不是函数错误。 我的剧本是Javascript 我想在我的WordPress站点中使用counterup.js,但它显示了错误,javascript,jquery,wordpress,Javascript,Jquery,Wordpress,我正在使用 js。在普通html中,它工作正常,但当我在WordPress中使用此脚本时,它显示未捕获的TypeError:undefined不是函数错误。 我的剧本是 <script src="http://cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js"></script> <script src="<?php bloginfo('template_directory');
<script src="http://cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js"></script>
<script src="<?php bloginfo('template_directory'); ?>/includes/jquery.counterup.js"></script>
<script>
jQuery(document).ready(function( $ ) {
$('.counter').counterUp({
delay: 10,
time: 1000
});
});
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-36251023-1']);
_gaq.push(['_setDomainName', 'jqueryscript.net']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
您将用于计数器的js文件作为CSS文件包括在内
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/includes/jquery.counterup.js">
您将用于计数器的js文件作为CSS文件包含在内
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/includes/jquery.counterup.js">
您将用于计数器的js文件作为CSS文件包含在内
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/includes/jquery.counterup.js">
您将用于计数器的js文件作为CSS文件包含在内
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/includes/jquery.counterup.js">
在jquery.min.js
链接之后移动waypoins.min.js
链接
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js"></script>
另外,
用于CSS,但您包括JS文件:
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/includes/jquery.counterup.js">
在jquery.min.js
链接之后移动waypoins.min.js
链接
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js"></script>
另外,
用于CSS,但您包括JS文件:
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/includes/jquery.counterup.js">
在jquery.min.js
链接之后移动waypoins.min.js
链接
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js"></script>
另外,
用于CSS,但您包括JS文件:
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/includes/jquery.counterup.js">
在jquery.min.js
链接之后移动waypoins.min.js
链接
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js"></script>
另外,
用于CSS,但您包括JS文件:
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/includes/jquery.counterup.js">
检查此项。您没有正确包含脚本
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/includes/jquery.counterup.js">
如果存在任何依赖项,还应在其他脚本之前加载jquery
WordPress附带捆绑的jQuery,建议使用它,而不是使用外部的。请检查此项。您没有正确包含脚本
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/includes/jquery.counterup.js">
如果存在任何依赖项,还应在其他脚本之前加载jquery
WordPress附带捆绑的jQuery,建议使用它,而不是使用外部的。请检查此项。您没有正确包含脚本
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/includes/jquery.counterup.js">
如果存在任何依赖项,还应在其他脚本之前加载jquery
WordPress附带捆绑的jQuery,建议使用它,而不是使用外部的。请检查此项。您没有正确包含脚本
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/includes/jquery.counterup.js">
如果存在任何依赖项,还应在其他脚本之前加载jquery
WordPress附带捆绑的jQuery,建议使用它,而不是使用外部的。删除
,然后重试。让我知道输出。同时应用TommyBs
答案。我可以查看您的网站吗?很抱歉,我现在正在脱机工作。请删除
,然后重试。让我知道输出。同时应用TommyBs
答案。我可以查看您的网站吗?很抱歉,我现在正在脱机工作。请删除
,然后重试。让我知道输出。同时应用TommyBs
答案。我可以查看您的网站吗?很抱歉,我现在正在脱机工作。请删除
,然后重试。让我知道输出。同时应用TommyBs
回答。我可以查看你的网站吗?对不起,我现在正在脱机工作。我替换了,但什么也没发生。我替换了,但什么也没发生。我替换了,但什么也没发生。谢谢你的建议,但这也不起作用。你能检查控制台有没有脚本加载错误吗?我只有一个未捕获的TypeError:undefined不是函数错误您使用“src”或“href”作为脚本标记的是哪一个?应该是src
我正在使用href。现在,当我将其更改为src时,它可以正常工作了。谢谢您的建议,但这也不起作用。您可以检查控制台是否存在任何脚本加载错误吗?我只得到了未捕获的TypeError:undefined不是一个函数错误。您使用“src”或“href”作为脚本标记的是哪一个?应该是src
我正在使用href。现在,当我将其更改为src时,它可以正常工作了。谢谢您的建议,但这也不起作用。您可以检查控制台是否存在任何脚本加载错误吗?我只得到了未捕获的TypeError:undefined不是一个函数错误。您使用“src”或“href”作为脚本标记的是哪一个?应该是src
我正在使用href。现在,当我将其更改为src时,它可以正常工作了。谢谢您的建议,但这也不起作用。您可以检查控制台是否存在任何脚本加载错误吗?我只得到了未捕获的TypeError:undefined不是一个函数错误。您使用“src”或“href”作为脚本标记的是哪一个?应该是src
我正在使用href。谢谢你现在它的工作完善时,我改变它的src。