我已经在SO上阅读了有关此主题的主题,但无法获得所需的o / p。他们说出现此问题是因为一些js文件被多次包含。但是我尝试一次一个地删除多个文件,但仍然出现TypeError: $(...).dialog is not a function
错误。我在哪里包含多个js文件?有人可以指出吗?谢谢。
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script type="text/javascript" src="{% static "js/bootstrap.js" %}" ></script>
<script type="text/javascript" src="{% static "dashboard/js/jquery-ui-personalized-1.6rc2.min.js" %}" ></script>
<script type="text/javascript" src="{% static "dashboard/js/inettuts.js" %}" ></script>
<script type="text/javascript" src="{% static "dashboard/js/dashboard.js" %}" ></script>
我得到的错误是:-
Error: Syntax error, unrecognized expression: #intro,
...nction(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"...
jquery.min.js (line 4)
TypeError: t.widget.extend is not a function
..."drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return thi...
jquery-ui.min.js (line 5)
您在同一页面上加载了几个jQuery库(同一事物的不同版本),这是错误的,除非您确实需要保持依赖于先前版本的旧插件正常工作。在这种特定情况下,您需要解决冲突。
这就是您所需要的:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script type="text/javascript" src="{% static "js/bootstrap.js" %}" ></script>
<!-- Not so sure what is this, but certainly it's another jQuery UI library being loaded on top of the other one -->
<!-- <script type="text/javascript" src="{% static "dashboard/js/jquery-ui-personalized-1.6rc2.min.js" %}" ></script>-->
<script type="text/javascript" src="{% static "dashboard/js/inettuts.js" %}" ></script>
<script type="text/javascript" src="{% static "dashboard/js/dashboard.js" %}" ></script>
在此处查找CSS样式表(使用主题):http : //jqueryui.com/
jQuery UI对话框:http://jqueryui.com/dialog/
更新
在我们就评论进行聊天之后,我发现您正在使用一个名为的插件inettuts
,该插件基于真正的旧版jQuery和jQuery UI库(1.2.x)。此外,它使用了不包含dialog
小部件的jQuery UI的自定义版本,因此出现了第一条错误消息。
您可以尝试使该插件适用于较新的版本(遵循其网站上的注释),或解决冲突并在同一页面上使用两个库。
现在由您决定。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句