我试图将完整日历的资源作为函数
callback is not a function
这是我的代码
$('#calendar').fullCalendar({
resources: function (callback) {
$.ajax({
type: "POST",
url: '../sales/Calendar.aspx/getResources',
cache: false,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
var resourceObjects = [];
$(data.d).each(function () {
resourceObjects.push({
id: this.id,
title: this.title,
});
});
callback(resourceObjects);
},
error: function (jqXHR, textStatus, errorThrown) {
alert('There was an error');
}
});
}
});
事件功能正在运行,但资源功能有问题。