Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/364.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:UncaughtTypeError:对象不是函数_Javascript - Fatal编程技术网

Javascript:UncaughtTypeError:对象不是函数

Javascript:UncaughtTypeError:对象不是函数,javascript,Javascript,我有一段代码: $(document).ready( function(){ $(".cb-enable").click(function(){ $("#repetitive").show(); var parent = $(this).parents('.switch'); $('.cb-disable',parent).removeClass('selected'); $(this).addClass('selected'); $('.checkbox

我有一段代码:

$(document).ready( function(){
$(".cb-enable").click(function(){
    $("#repetitive").show();
    var parent = $(this).parents('.switch');
    $('.cb-disable',parent).removeClass('selected');
    $(this).addClass('selected');
    $('.checkbox',parent).attr('checked', true);
    $("#repetitiveHidden").empty();
    $("#repetitiveHidden").val("true");
});
$(".cb-disable").click(function(){
    $("#repetitive").hide();
    var parent = $(this).parents('.switch');
    $('.cb-enable',parent).removeClass('selected');
    $(this).addClass('selected');
    $('.checkbox',parent).attr('checked', false);
    $("#repetitiveHidden").empty();
    $("#repetitiveHidden").val("false");
});
$(".overnight-enable").click(function(){
    var parent = $(this).parents('.switch');
    $('.overnight-disable',parent).removeClass('selected');
    $(this).addClass('selected');
    $('.checkbox',parent).attr('checked', true);
    $("#overnightHidden").empty();
    $("#overnightHidden").val("true");
});
$(".overnight-disable").click(function(){
    var parent = $(this).parents('.switch');
    $('.overnight-enable',parent).removeClass('selected');
    $(this).addClass('selected');
    $('.checkbox',parent).attr('checked', false);
    $("#overnightHidden").empty();
    $("#overnightHidden").val("false");
});
$(".rep-daily").click(function(){
    var parent = $(this).parents('.switch');
    $('.rep-weekly',parent).removeClass('selected');
    $(this).addClass('selected');
    $('.checkbox',parent).attr('checked', true);
    $("#reccurType").empty();
    $("#reccurType").val("true");
});
$(".rep-weekly").click(function(){
    var parent = $(this).parents('.switch');
    $('.rep-daily',parent).removeClass('selected');
    $(this).addClass('selected');
    $('.checkbox',parent).attr('checked', false);
    $("#reccurType").empty();
    $("#reccurType").val("false");
});
$(".rep-cycle").click(function(){
    var parent = $(this).parents('.switch');
    $('.rep-endDate',parent).removeClass('selected');
    $(this).addClass('selected');
    $('.checkbox',parent).attr('checked', true);
    $("#reccurWay").empty();
    $("#reccurWay").val("true");
    $("#endDate").hide();
    $("#cycle").show();
});
$(".rep-endDate").click(function(){
    var parent = $(this).parents('.switch');
    $('.rep-cycle',parent).removeClass('selected');
    $(this).addClass('selected');
    $('.checkbox',parent).attr('checked', false);
    $("#reccurWay").empty();
    $("#reccurWay").val("false");
    $("#cycle").hide();
    $("#endDate").show();
});

 })(jQuery);
在这一行:

})(jQuery);
我有一个错误UncaughtTypeError:对象不是函数 请帮助

只需删除以下内容:

 })(jQuery);

因为您调用的不是匿名函数,而是文档就绪,不需要直接调用。

只需删除以下内容:

 })(jQuery);

因为您调用的不是匿名函数,而是文档就绪,不需要直接调用。

只需删除以下内容:

 })(jQuery);

因为您调用的不是匿名函数,而是文档就绪,不需要直接调用。

只需删除以下内容:

 })(jQuery);


因为您调用的不是匿名函数,而是文档准备好了,不需要这样直接调用。

这可能是需要快速回答的最好借口。@GalV他在问题中说了一行。所有代码都在一行,尝试注释/删除部分代码以检查错误在哪里……这可能是需要快速回答的最好借口。@GalV他在问题中说了这一行。所有代码都在一行,尝试注释/删除部分代码以检查错误在哪里……这可能是需要快速回答的最好借口。@GalV他在问题中说了这一行。所有代码都在一行,尝试注释/删除部分代码以检查错误在哪里…这可能是需要快速回答的最好借口。@GalV他在问题中说了这一行。所有代码都在一行中,尝试注释/删除部分代码以检查错误在哪里。。。