Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/445.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jQuery未捕获的TypeError,但在不同的页面上工作_Javascript_Php_Jquery_Html_Css - Fatal编程技术网

Javascript jQuery未捕获的TypeError,但在不同的页面上工作

Javascript jQuery未捕获的TypeError,但在不同的页面上工作,javascript,php,jquery,html,css,Javascript,Php,Jquery,Html,Css,我在控制台中收到以下错误消息: 这是来自此网页: 但是,在原始页面上,它可以工作:这是因为以下代码 $("#bingo tr td:not(.bingo_select), #selected td").toggle(function () { $(this).addClass("greensquare"); }, function () { $(this).addClass("redsquare").removeClass("greensquare"); }, function

我在控制台中收到以下错误消息:

这是来自此网页:


但是,在原始页面上,它可以工作:

这是因为以下代码

$("#bingo tr td:not(.bingo_select), #selected td").toggle(function () {
    $(this).addClass("greensquare");
}, function () {
    $(this).addClass("redsquare").removeClass("greensquare");
}, function () {
    $(this).removeClass("redsquare");
});
此版本的已在中删除

在执行这段代码时,jQuery假定它是采用3个参数的版本,因此它将第二个参数(函数)视为
easing
值,并在内部使用它

return this.pos = b = this.options.duration ? o.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : Kb.propHooks._default.set(this), this

作为一个解决方案,看看这个插件

你有没有像
$(this).addClass(“redsquare”).removeClass(“greensquare”)这样的脚本这个
是否是您期望的值?