来自经典asp页面的FullCalendar.js外部事件数据

FullCalendar.js external events data from classic asp page

本文关键字:js FullCalendar 外部 事件 数据 经典 asp      更新时间:2023-09-26

我正在努力从asp获得外部事件数据到fullcalendar.js我正在使用fullcalendar中的演示文件。IO,不知道如何让我的数据显示在所有

$(document).ready(function() {
        $('#calendar').fullCalendar({       
            url: '../../data/calendar.asp',
});
});

, asp页面以以下方式显示数据

{"事件":[{"标题":"测试标题","开始":"2016 - 04 - 28 t16:30:00z"、"结束":"2016 - 04 - 28 - t17:30:00z"},{"标题":"另一个测试标题,"开始":"2016 - 05 - 05 t16:30:00z"、"结束":"2016 - 05 - 05 - t17:30:00z "},{"标题":"最终测试标题"、"开始":"2016 - 05 - 05 t17:30:00z","结束":"2016 - 05 - 05 - t17:30:00z"}]}

如有任何建议,我将不胜感激

你可以使用getJson从asp页面获取json,然后使用events元素:

$(function(){
$.getJSON( "../../data/calendar.asp", function( data ) {
    $('#calendar').fullCalendar({
     events: data.events
    }); 
});
});