Javascript google日历事件不会显示到fullcalendar localhost

Javascript google日历事件不会显示到fullcalendar localhost,javascript,jquery,laravel,fullcalendar,google-calendar-api,Javascript,Jquery,Laravel,Fullcalendar,Google Calendar Api,我试图在我使用Laravel5.4开发的本地站点中显示来自谷歌日历的事件。我决定不尝试使用laravel库,因为在这方面我找不到很多例子。 无论如何,在设置日历之后,我在谷歌日历中添加的事件不会显示出来 这是我最基本的代码: @extends('layouts.home') @section('content') <script type="text/javascript"> $(document).ready(function() { $('#calenda

我试图在我使用Laravel5.4开发的本地站点中显示来自谷歌日历的事件。我决定不尝试使用laravel库,因为在这方面我找不到很多例子。 无论如何,在设置日历之后,我在谷歌日历中添加的事件不会显示出来

这是我最基本的代码:

@extends('layouts.home')
@section('content')
<script type="text/javascript">
    $(document).ready(function() {
        $('#calendar').fullCalendar({
            googleCalendarApiKey: 'RemovedSensitiveData',
            events: {
                googleCalendarId: 'mjd3mg13mecqeb3ltcc9n4fmcc@group.calendar.google.com',
                className: 'gcal-event',
                events: 'https://calendar.google.com/calendar/embed?src=mjd3mg13mecqeb3ltcc9n4fmcc%40group.calendar.google.com&ctz=Europe/Bucharest'
            }
        });
    });
</script>
<div id='calendar'></div>
@stop
这就是页面中呈现的内容。

这是我在谷歌日历上的内容:


我的谷歌日历是公开的。

请确保使用了正确的URL。想要一个XML提要,而不是整个日历。由于您的日历已公开,因此,您必须获取日历的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.
相关线程:


希望这有帮助

这是最近将FullCalendar与谷歌日历一起使用时发生的变化,我花了一段时间才让它工作起来,所以我想我会与大家分享

您拥有的“googleCalendarId”应该在“事件”行中。所以应该是这样的:

 googleCalendarApiKey: 'RemovedSensitiveData',
 events: 'mjd3mg13mecqeb3ltcc9n4fmcc@group.calendar.google.com',
以下是FullCalendar网站的演示:

如果您“查看源代码”,您将看到他们是如何为演示构建代码的。我也复制了下面的内容作为参考

<script>

$(document).ready(function() {

    $('#calendar').fullCalendar({

        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,listYear'
        },

        displayEventTime: false, // don't show the time column in list view

        // THIS KEY WON'T WORK IN PRODUCTION!!!
        // To make your own Google API key, follow the directions here:
        // http://fullcalendar.io/docs/google_calendar/
        googleCalendarApiKey: 'AIzaSyDcnW6WejpTOCffshGDDb4neIrXVUA1EAE',

        // US Holidays
        events: 'en.usa#holiday@group.v.calendar.google.com',

        eventClick: function(event) {
            // opens events in a popup window
            window.open(event.url, 'gcalevent', 'width=700,height=600');
            return false;
        },

        loading: function(bool) {
            $('#loading').toggle(bool);
        }

    });

});

谢谢你,它确实有帮助,因为我有错误的链接。但它仍然不起作用,可能是它缺少了什么,我不完全明白需要做些什么才能让它起作用。我将进一步研究这个问题。谢谢你的链接和回复。
<script>

$(document).ready(function() {

    $('#calendar').fullCalendar({

        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,listYear'
        },

        displayEventTime: false, // don't show the time column in list view

        // THIS KEY WON'T WORK IN PRODUCTION!!!
        // To make your own Google API key, follow the directions here:
        // http://fullcalendar.io/docs/google_calendar/
        googleCalendarApiKey: 'AIzaSyDcnW6WejpTOCffshGDDb4neIrXVUA1EAE',

        // US Holidays
        events: 'en.usa#holiday@group.v.calendar.google.com',

        eventClick: function(event) {
            // opens events in a popup window
            window.open(event.url, 'gcalevent', 'width=700,height=600');
            return false;
        },

        loading: function(bool) {
            $('#loading').toggle(bool);
        }

    });

});