[英]Uncaught Error: Syntax error, unrecognized expression after jQuery upgrade
After upgrading my jQuery version, this issue appears. 升级我的jQuery版本后,出现此问题。 After hours of work (there were lot of jquery files ) i finally found from is is this issue raising - because in console its pointing me toward actual file just pointing to jQuery file. 经过几个小时的工作(有很多jquery文件),我最终发现的是这个问题的提出-因为在控制台中,它指向我的是实际文件,只是指向jQuery文件。
Here is what in my console shows : 这是我的控制台中显示的内容:
Uncaught Error: Syntax error, unrecognized expression: .menu-item > a[href*=#], .porto-sticky-nav .nav > li > a[href*=#], a[href^=#].hash-scroll, .hash-scroll-wrap a[href^=#]
This is triggering from this code : 这是从以下代码触发的:
$('.menu-item > a[href*=#], .porto-sticky-nav .nav > li > a[href*=#], a[href^=#].hash-scroll, .hash-scroll-wrap a[href^=#]').on('click', function(e) {
// My code goes here...
});
Can any one let me know what's i am doing wrong? 有人可以让我知道我在做什么错吗?
add quotes to #
. 给#
加上引号。 change #
to "#"
将#
更改为"#"
$('.menu-item > a[href*="#"], .porto-sticky-nav .nav > li > a[href*="#"], a[href^="#"].hash-scroll, .hash-scroll-wrap a[href^="#"]').on('click', function(e) {
// My code goes here...
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.