$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: "/Home/getEvents",
dataType: "json",
processData: true,
success: function (data) {
$.each(data, function (i, li) {
var source = {
events: [
{
title:li.title,start:li.start,end:li.end,className:li.type
}
]
};
//$('#calen').fullCalendar('addEventSource', source);
$('#Calendar').fullCalendar({ eventSources: [source] });
});
}
});
以上是我的代码,请任何人在该代码上找到我的错误。
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: "/Home/getEvents",
dataType: "json",
processData: true,
success: function(){
$.each(data, function (i, li) {
var source = {
events: [ {
title:li.title,
start:li.start,
end:li.end,
className:li.type
} ]
};
});
}
});
下次在浏览器中检查控制台。