我刚刚开始学习JQuery,并找到了一个对我正在做的事情(droppable,draggable,clone等)有用的例子。它在网站上运行得很好:
http://jqueryui.com/droppable/#shopping-cart
但不知何故,如果我使用Notepad++从我的计算机上运行它,它会给我一个“引用错误:$ is not defined”。
我发现了很多关于这个话题的讨论,以及很多有用和精彩的链接,例如:
http://jquery-howto.blogspot.ca/2013/02/referenceerror-jquery-is-not-defined.html
http://ryanrahlf.com/knockout-js-why-we-use-self-or-how-to-fix-referenceerror-xyz-is-not-defined/
但对我来说,这仍然是一个难题。
我将非常感谢您的反馈。
谢谢你,拉斯
发布于 2015-04-24 00:26:55
要从本地计算机运行此示例,您需要替换以下4个标记:
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script
<link rel="stylesheet" href="/resources/demos/style.css">在href中使用完整urls (使用http架构):
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script
<link rel="stylesheet" href="http://jqueryui.com/droppable/resources/demos/style.css">否则,它将尝试包含本地文件系统中的jquery,即使用file::schema
https://stackoverflow.com/questions/29829104
复制相似问题