【问题标题】:jquery DOMException: Failed to execute 'querySelectorAll' on 'Element'jquery DOMException:无法在“元素”上执行“querySelectorAll”
【发布时间】:2016-07-30 15:13:42
【问题描述】:

请帮忙。当我将 jquery 添加到几乎空的站点时,它显示了这个:

DOMException:无法在“元素”上执行“querySelectorAll”: '*,:x' 不是有效的选择器。 在错误(本机) 在http://localhost/Sites/Humator/www/assets/plugins/jquery/jquery-2.2.3.min.js:2:10517 在 ia (http://localhost/Sites/Humator/www/assets/plugins/jquery/jquery-2.2.3.min.js:2:7373) 在 fa.setDocument (http://localhost/Sites/Humator/www/assets/plugins/jquery/jquery-2.2.3.min.js:2:10255) 在 http://localhost/Sites/Humator/www/assets/plugins/jquery/jquery-2.2.3.min.js:2:22073 在 http://localhost/Sites/Humator/www/assets/plugins/jquery/jquery-2.2.3.min.js:2:22793 在 http://localhost/Sites/Humator/www/assets/plugins/jquery/jquery-2.2.3.min.js:2:207 在 http://localhost/Sites/Humator/www/assets/plugins/jquery/jquery-2.2.3.min.js:2:212

我不知道它是什么,因为我的网站现在没有任何查询。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
</head>
<body>
    <div class="container">
    </div>
     <script type="text/javascript">var plugin_path = 'assets/plugins/';</script>
     <script type="text/javascript" src="assets/plugins/jquery/jquery-2.2.3.min.js"></script>
</body>
</html>  

请问我该如何解决?我使用 Chrome - 最新版本

【问题讨论】:

标签: jquery


【解决方案1】:

jQuery 通过查看它抛出的异常来确定您正在使用的浏览器。在这种情况下:

// Opera 10-11 does not throw on post-comma invalid pseudos
el.querySelectorAll("*,:x");
rbuggyQSA.push(",.*:");

所以您需要做的就是将调试器设置为“忽略捕获的异常”。

【讨论】:

    猜你喜欢
    • 2018-11-04
    • 2019-01-11
    • 2021-07-19
    • 2016-05-16
    • 1970-01-01
    • 2018-06-16
    • 1970-01-01
    • 1970-01-01
    • 2016-12-03
    相关资源
    最近更新 更多