gpt4 book ai didi

JavaScript 语法错误 : Unexpected identifier

转载 作者:行者123 更新时间:2023-11-28 20:58:20 25 4
gpt4 key购买 nike

我写了一些小脚本,但由于我是在 Google 的帮助下完成的,所以我需要一些建议。将其放入 Chrome 控制台后,我收到此错误:

SyntaxError: Unexpected identifier

这是我的代码:

jQuery(document).ready(function(){ 
if jQuery("#colorbox").css("display", "none");) {
jQuery("#close-news").css("display", "none");
}
else {
jQuery("#close-news").css("display", "visible");
}
});

有什么问题吗?

最佳答案

更改:

if jQuery("#colorbox").css("display", "none");)

至:

if (jQuery("#colorbox").css("display") == 'none')

关于JavaScript 语法错误 : Unexpected identifier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11653281/

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