[英]TypeError: undefined is not a function (evaluating '$(“#typed”).typed')
I'm using a plugin Typed.js When I initialize the function the error mentioned pops up. 我正在使用插件Typed.js初始化函数时,出现上述错误。 It suggests that the jquery is not loaded before the plugin but I don't see why.
它表明jQuery没有在插件之前加载,但我不明白为什么。
HTML HTML
<script type="text/javascript" src="jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="typed.js"></script>
in the header. 在标题中。
And 和
<script>
function type(){
$("#type").typed({
strings: ["^1000to the biggest student organised fest in Kanpur", "to the biggest student organised fest in UP", "to the biggest student organised fest in <span style='color: #ffee00'>India</span> ^800."],
typeSpeed: 10,
stringstops: [41, 41, 41],
backDelay: 600,
showCursor: true,
loop: false,
contentType: 'html', // or text
// defaults to false for infinite loop
loopCount: false,
});
}
window.onload=type;
</script>
at the end of the body. 在身体的尽头。
Can anybody find the mistake please? 有人能找到错误吗?
Check your code , having duplicate <script src="js/jquery-2.2.3.min.js"></script>
is equal to not including jQuery . 检查您的代码,重复的
<script src="js/jquery-2.2.3.min.js"></script>
等于不包括jQuery 。
remove the duplicate ... 删除重复的...
If jQuery wasn't loaded, then it would throw a reference error on $
. 如果未加载jQuery,则会在
$
上引发引用错误。
It says .typed
is undefined so either: 它说
.typed
是未定义的,所以:
src="typed.js"
is not returning the script or src="typed.js"
URL未返回脚本或 typed
property typed
属性 Assuming I've found the right script, it definitely isn't option 2: http://jsfiddle.net/1gap1b39/ 假设我找到了正确的脚本,那肯定不是选项2: http : //jsfiddle.net/1gap1b39/
Check the Net tab of your developer tools to make sure you are getting a 200 OK
response for the script. 检查开发人员工具的“网络”选项卡,以确保脚本得到
200 OK
响应。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.