JavaScript中的奇怪的意外令牌ILLEGAL [英] Strange Unexpected token ILLEGAL in JavaScript
本文介绍了JavaScript中的奇怪的意外令牌ILLEGAL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
基于W3的jQuery学校,这应该是可以的。
任何人都可以帮忙?
< script type =text / javascript>
jQuery(document).ready(function($){
$(a)。click(function(){
**未捕获的语法错误:意外的标记ILLEGAL **
$(#content).toggle(400);
});
});
< / script>
解决方案
字符串需要用 U + 0022
(双引号 - )字符或
U + 0027
(撇号 - '
)字符
您的第一个选择器 a
包含一对 U + 201C
/ U + 201D
(左双引号/右双引号 - /
)字符
您的第二个选择器( #content
)根本没有引号。
I have a syntax error which I cannot solve. Based on W3 jQuery schools, this should be okay. Can anyone help?
<script type="text/javascript">
jQuery(document).ready(function($) {
$("a").click(function(){
**Uncaught SyntaxError: Unexpected token ILLEGAL**
$(#content).toggle(400);
});
});
</script>
解决方案
Strings need to be surrounded with U+0022
(double quote - "
) characters or U+0027
(apostrophe - '
) characters.
Your first selector, a
is surrounded with a pair of U+201C
/U+201D
(left double quotation mark/right double quotation mark - "
/"
) characters.
Your second selector (#content
) has no quotes around it at all.
这篇关于JavaScript中的奇怪的意外令牌ILLEGAL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文