JQUERY:未捕获的错误:语法错误,无法识别的表达式 [英] JQUERY: Uncaught Error: Syntax error, unrecognized expression
本文介绍了JQUERY:未捕获的错误:语法错误,无法识别的表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
console.log($('"#'+d+'"'));
在html中,我有
<div id="2013-10-23">
<h1>5</h1>
<p>eeeeeeeeeeee</p>
</div>
它引发错误:
未捕获的错误:语法错误,无法识别的表达式:#2013-10-23"
Uncaught Error: Syntax error, unrecognized expression: "#2013-10-23"
在上面的代码中,我有一个id="2013-10-23"
的div,当获取该ID作为响应时,它抛出语法错误
In above code i have one div with id="2013-10-23"
and when getting that id in response it is throwing syntax error
推荐答案
尝试
console.log($("#"+d));
您的解决方案将双引号作为字符串的一部分传递.
your solution is passing the double quotes as part of the string.
这篇关于JQUERY:未捕获的错误:语法错误,无法识别的表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文