当我初始化这个函数时,我使用的是插件Typed.js,上面提到的错误会弹出。它表明jquery不是在插件之前加载的,但我不明白为什么。
HTML
<script type="text/javascript" src="jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="typed.js"></script>在头上。
和
<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>在身体的末端。
有人能找到这个错误吗?
发布于 2016-06-03 10:20:24
检查您的代码,重复<script src="js/jquery-2.2.3.min.js"></script>等于(不包括jQuery )。
删除副本..。
发布于 2015-04-27 10:45:05
如果没有加载jQuery,那么它将在$上抛出一个引用错误。
它说.typed是未定义的,所以要么:
src="typed.js"的URL不返回脚本或typed属性假设我找到了正确的脚本,它肯定不是选项2:http://jsfiddle.net/1gap1b39/
检查开发工具的Net选项卡,以确保获得脚本的200 OK响应。
https://stackoverflow.com/questions/29893479
复制相似问题