javascript - 全日历js : fetching more events with ajax

标签 javascript json fullcalendar

我正在使用fullcalendar , 如何从同一服务器端、多个 URL 获取更多事件? 第一个有效,我只想在附加事件到达时添加它们(ajax)。

最佳答案

您可以使用 Ajax 获取数据,然后动态添加新源

$.ajax({
  url: "test.html",
  success: function(data){
       var source = { events: [
                            {
                                title: data.getTitle(),
                                start: new Date(year, month, day)
                            }
                ]};
                $('#calendar').fullCalendar( 'addEventSource', source );
  }
});

关于javascript - 全日历js : fetching more events with ajax,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8218224/

相关文章:

json - PostgreSQL JSONB - 具有可变键名的查询条件

javascript - 如何设置完整日历显示下个月

Angular FullCalendar 无法读取属性

javascript - 检查对象中的任何数组是否包含空值

javascript - 如何使用 Angular.js 从 API 的下拉列表中选择特定数据来显示相关数据?

json - Postgresql jsonb_agg 子查询排序

json - React Native 打包器找不到 package.json

javascript - 全日历事件仅并排重叠

php - PHP session 的 JavaScript 重定向问题

javascript - 如何检查jquery中是否需要单选按钮