简体   繁体   English

未捕获的TypeError:布尔不是Fullcalendar中的Ajax调用函数

[英]Uncaught TypeError: boolean is not a function on ajax call in fullcalendar

i have a fullcalendar working on my app and i added the following method to filter results by user: 我在我的应用程序上有一个全日历工作,我添加了以下方法来按用户过滤结果:

function filter_by_provider(selected_provider) {
    $('#calendar').fullCalendar( 'removeEvents' );
    $('#calendar').fullCalendar( 'addEventSource', function(start, end, callback) {
                $.getJSON(source, function(data){
                    var eventsToShow = [];
                    for(var i=0; i<data.length; i++){
                        if(data[i].provider == selected_provider || selected_provider == ""){
                            eventsToShow.push(data[i]);
                        };
                    };
                    callback(eventsToShow); //here's the Error
                });
            });
};

The thing is callback doesnt seem to be working and i keep getting this Error on that line: 事情是回调似乎不起作用,我一直在那条线上收到此错误:

Uncaught TypeError: boolean is not a function

Could it be that jquery is not properly installed? 可能是jquery安装不正确吗? Am i missing something? 我想念什么吗?

I'd appreciate any help. 我将不胜感激。 Thanks in advance. 提前致谢。

Try: 尝试:

$('#calendar').fullCalendar( 'addEventSource', function(start, end, timezone, callback) {

It's in docs : docs中

timezone is a string/boolean describing the calendar's current timezone. timezone是一个字符串/布尔值,描述了日历的当前时区。 It is the exact value of the timezone option. 它是时区选项的确切值。

检查回调对象的类型,它看起来像您的callback = true或false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM