无法获取fullcalendar以显示Google日历中的事件

无法获取fullcalendar以显示Google日历中的事件,fullcalendar,Fullcalendar,这很奇怪。我只是想用一个共享的Google日历来建立fullcalendar的基本功能。我试着简单地用我自己的日历URL替换gcal演示“gcal.html”。日历可以自行打开。下面是一些代码: <head> <link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' /> <link rel='stylesheet' type='text/css' href='../

这很奇怪。我只是想用一个共享的Google日历来建立fullcalendar的基本功能。我试着简单地用我自己的日历URL替换gcal演示“gcal.html”。日历可以自行打开。下面是一些代码:

<head>
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' />
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.print.css' media='print' />
<script type='text/javascript' src='../jquery/jquery-1.7.1.min.js'></script>
<script type='text/javascript' src='../jquery/jquery-ui-1.8.17.custom.min.js'></script>
<script type='text/javascript' src='../fullcalendar/fullcalendar.min.js'></script>
<script type='text/javascript' src='../fullcalendar/gcal.js'></script>
<script type='text/javascript'>

    $(document).ready(function() {

        $('#calendar').fullCalendar({
        header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,basicWeek,basicDay'
            },
            // US Holidays
            events: 'https://www.google.com/calendar/embed?src=r9k375tdhq8auc1oc4kgmhpri4%40group.calendar.google.com&ctz=America/Chicago',
            eventClick: function(event) {
                // opens events in a popup window
                window.open(event.url, 'gcalevent', 'width=700,height=600');
                return false;
            },

            loading: function(bool) {
                if (bool) {
                    $('#loading').show();
                }else{
                    $('#loading').hide();
                }
            }

        });

    });

</script>

$(文档).ready(函数(){
$(“#日历”).fullCalendar({
标题:{
左:“上一个,下一个今天”,
中心:'标题',
右图:“月,基本周,基本日”
},
//美国假日
事件:'https://www.google.com/calendar/embed?src=r9k375tdhq8auc1oc4kgmhpri4%40group.calendar.google.com&ctz=America/Chicago',
事件单击:函数(事件){
//在弹出窗口中打开事件
打开(event.url,'gcalevent','width=700,height=600');
返回false;
},
加载:函数(bool){
如果(bool){
$(“#加载”).show();
}否则{
$(“#加载”).hide();
}
}
});
});

我非常确信我拥有所有正确的依赖项,等等,因为我在gcal演示中。当我将URL插入地址栏时,我的日历将以其他方式打开。此日历设置为公共日历。任何帮助都将不胜感激。如果我能让它工作的话,完整日历和谷歌日历似乎是一个很好的搭配。

你没有使用正确的URL。FullCalendar需要一个XML提要,而不是您提供的整个日历

尝试以下步骤:

您必须首先公开您的谷歌日历:

In the Google Calendar interface, locate the "My Calendar" box on the left.
Click the arrow next to the calendar you need.
A menu will appear. Click "Share this calendar."
Check "Make this calendar public."
Make sure "Share only my free/busy information" is unchecked.
Click "Save."
然后,您必须获取日历的XML提要URL:

In the Google Calendar interface, locate the "My Calendar" box on the left
Click the arrow next to the calendar you need.
A menu will appear. Click "Calendar settings."
In the "Calendar Address" section of the screen, click the XML badge.
Your feed's URL will appear.
我相信这就是你想要的网址


谢谢布兰登!我知道这是件愚蠢的事,但我的眼睛看不见。谢谢@威尔,没问题。如果这解决了您的问题,请不要忘记,您可以通过选中复选标记将其标记为已接受的答案。