gpt4 book ai didi

javascript - Bootstrap .dropdown() "Uncaught TypeError: undefined is not a function"

转载 作者:搜寻专家 更新时间:2023-10-31 22:12:35 25 4
gpt4 key购买 nike

我知道以前有人问过这个问题,但不知何故,没有一个针对其他人的修复对我有用。我觉得这与导入我的插件有关。在 Bootstrap 下拉框中单击一个字段时,我在控制台中为这行代码得到“undefined is not a function”:

$target.closest( '.btn-group' )
.find( '[data-bind="label"]' ).text( $target.text() )
.end()
.children( 'dropdown-toggle' ).dropdown('toggle');

这是我在 HTML 中的导入代码:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="application/javascript" data-main="static/js/main" src="static/js/libs/require/2.1.11/require.js"></script>
<script src="static/js/libs/bootstrap/bootstrap.min.js"></script>
<link href="static/css/bootstrap.min.css" media="screen" rel="stylesheet" type="text/css">

每当我单击下拉框时,我的控制台的“网络”选项卡中也会出现此错误,它表示请求已被取消:

file:///home/chad/.config/google-chrome/Default/Extensions/gkojfkhlekighikafcpjkiklfbnlmeio/1.6.222_0/js/jquery.min.map

如有任何帮助,我们将不胜感激!几个小时以来,我一直在努力解决问题。

最佳答案

远景,但您使用的是名为“Hola”的 chrome 扩展程序吗?我注意到这条消息

Denying load of chrome-extension://gkojfkhlekighikafcpjkiklfbnlmeio/js/jquery.min.map. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.

在测试我正在开发的 Web 应用程序时,发现是该扩展导致了错误,只是将其禁用,消息不再出现。我也在使用 Bootstrap ,不知道是否与此有关。

“//”后面的代码是扩展的id,可以和Chrome扩展配置中的id对比,见this image并注意 id 与错误中的相同。

希望这对您有所帮助。

关于javascript - Bootstrap .dropdown() "Uncaught TypeError: undefined is not a function",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28439396/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com