gpt4 book ai didi

javascript - jquery语法错误非法字符

转载 作者:行者123 更新时间:2023-11-29 16:46:15 24 4
gpt4 key购买 nike

我一直在 Firebug 中收到非法字符的错误

 $('#service_chk').click(function () {
var $this = $(this);
if ($this.is(':checked')) {
$('#service').css('display'​​​​​​​​​​​​​​​​​​​​​​​​​​​,'block');​​​​​​
} else {
$('#service').css('display'​​​​​​​​​​​​​​​​​​​​​​​​​​​,'none');​​​​​​
}
});

在$('#service').css('display'中一直指向“coma”错误,' block ');

这是我的看法

<tr>
<td><input type="checkbox" id="service_chk"></td>
<td style="text-align:center;"><input type="text" class="form-control" id="service" style="display:none;"></td>
</tr>

我正在学习javascript,请帮助我,谢谢。

最佳答案

问题是因为您的文本编辑器或您使用的 IDE 中的编码。将脚本复制粘贴到 jsfiddle 中,您将看到错误。 enter image description here

HTML

        <tr>
<td>
<input type="checkbox" id="service_chk">
</td>
<td style="text-align:center;">
<input type="text" class="form-control" id="service" style="display:none;">
</td>
</tr>

链接:http://jsfiddle.net/GCu2D/1655/

关于javascript - jquery语法错误非法字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41138580/

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