Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/379.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 无法设置未定义的属性“gcalFeed”,gcal.js出错_Jquery_Fullcalendar_Gcal - Fatal编程技术网

Jquery 无法设置未定义的属性“gcalFeed”,gcal.js出错

Jquery 无法设置未定义的属性“gcalFeed”,gcal.js出错,jquery,fullcalendar,gcal,Jquery,Fullcalendar,Gcal,当我调用gcal.js时,我正在使用fullcalendar.js。我在控制台中发现错误,“无法设置未定义的属性”gcalFeed“有人知道gcalFeed是什么以及可以设置为什么值吗? 下面是代码 pagerfunction=函数{ // full calendar var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); var hdr = {

当我调用gcal.js时,我正在使用fullcalendar.js。我在控制台中发现错误,“无法设置未定义的属性”gcalFeed“有人知道gcalFeed是什么以及可以设置为什么值吗? 下面是代码 pagerfunction=函数{

// full calendar

var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();

var hdr = {
    left: 'title',
    center: 'month,agendaWeek,agendaDay',
    right: 'prev,today,next'
};

var initDrag = function (e) {
    // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
    // it doesn't need to have a start or end

    var eventObject = {
        title: $.trim(e.children().text()), // use the element's text as the event title
        description: $.trim(e.children('span').attr('data-description')),
        icon: $.trim(e.children('span').attr('data-icon')),
        className: $.trim(e.children('span').attr('class')) // use the element's children as the event class
    };
    // store the Event Object in the DOM element so we can get to it later
    e.data('eventObject', eventObject);

    // make the event draggable using jQuery UI
    e.draggable({
        zIndex: 999,
        revert: true, // will cause the event to go back to its
        revertDuration: 0 //  original position after the drag
    });
};

var addEvent = function (title, priority, description, icon) {
    title = title.length === 0 ? "Untitled Event" : title;
    description = description.length === 0 ? "No Description" : description;
    icon = icon.length === 0 ? " " : icon;
    priority = priority.length === 0 ? "label label-default" : priority;

    var html = $('<li><span class="' + priority + '" data-description="' + description + '" data-icon="' +
        icon + '">' + title + '</span></li>').prependTo('ul#external-events').hide().fadeIn();

    $("#event-container").effect("highlight", 800);

    initDrag(html);
};

/* initialize the external events
 -----------------------------------------------------------------*/

$('#external-events > li').each(function () {
    initDrag($(this));
});

$('#add-event').click(function () {
    var title = $('#title').val(),
        priority = $('input:radio[name=priority]:checked').val(),
        description = $('#description').val(),
        icon = $('input:radio[name=iconselect]:checked').val();

    addEvent(title, priority, description, icon);
});

/* initialize the calendar
 -----------------------------------------------------------------*/

$('#calendar').fullCalendar({

    header: hdr,
    buttonText: {
        prev: '<i class="fa fa-chevron-left"></i>',
        next: '<i class="fa fa-chevron-right"></i>'
    },

    editable: true,
    droppable: true, // this allows things to be dropped onto the calendar !!!

    drop: function (date, allDay) { // this function is called when something is dropped

        // retrieve the dropped element's stored Event Object
        var originalEventObject = $(this).data('eventObject');

        // we need to copy it, so that multiple events don't have a reference to the same object
        var copiedEventObject = $.extend({}, originalEventObject);

        // assign it the date that was reported
        copiedEventObject.start = date;
        copiedEventObject.allDay = allDay;

        // render the event on the calendar
        // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
        $('#calendar').fullCalendar('renderEvent', copiedEventObject, true);

        // is the "remove after drop" checkbox checked?
        if ($('#drop-remove').is(':checked')) {
            // if so, remove the element from the "Draggable Events" list
            $(this).remove();
        }

    },

    select: function (start, end, allDay) {
        var title = prompt('Event Title:');
        if (title) {
            calendar.fullCalendar('renderEvent', {
                title: title,
                start: start,
                end: end,
                allDay: allDay
            }, true // make the event "stick"
            );
        }
        calendar.fullCalendar('unselect');
        // this is the google calender url. 
        // see docs at http://fullcalendar.io/docs/google_calendar/
        // todo getting error check http://jsfiddle.net/100thGear/QKPFQ/

        events: 'https://www.google.com/calendar/feeds/herb.williams%40softwaretechnologygroup.com/public/basic'

    },
    eventRender: function (event, element, icon) {
        if (!event.description == "") {
            element.find('.fc-event-title').append("<br/><span class='ultra-light'>" + event.description +
                "</span>");
        }
        if (!event.icon == "") {
            element.find('.fc-event-title').append("<i class='air air-top-right fa " + event.icon +
                " '></i>");
        }
    },

    windowResize: function (event, ui) {
        $('#calendar').fullCalendar('render');
    }
});

/* hide default buttons */
$('.fc-header-right, .fc-header-center').hide();



$('#calendar-buttons #btn-prev').click(function () {
    $('.fc-button-prev').click();
    return false;
});

$('#calendar-buttons #btn-next').click(function () {
    $('.fc-button-next').click();
    return false;
});

$('#calendar-buttons #btn-today').click(function () {
    $('.fc-button-today').click();
    return false;
});

$('#mt').click(function () {
    $('#calendar').fullCalendar('changeView', 'month');
});

$('#ag').click(function () {
    $('#calendar').fullCalendar('changeView', 'agendaWeek');
});

$('#td').click(function () {
    $('#calendar').fullCalendar('changeView', 'agendaDay');
});
})

//结束页功能

//loadscript和runpagefunction
loadScriptjs/plugin/fullcalendar/jquery.fullcalendar.min.js,pagefunction

嗨,赫伯,欢迎光临。您必须展示如何使用fullcalendar.js以及如何调用gcal.js,以便能够重现您的问题。我今天刚刚了解到,我们必须在加载完完整日历后加载gcal,以便gcal正常工作。不记得是否是相同的错误消息。感谢您的输入,我在加载fullcalendar.js之前加载了gcal.js,然后加载到fullcalendar.js,但是仍然得到相同的错误uncaughttypeerror:无法设置未定义问题的属性“gcalFeed”以包含更多信息。以下是一个有用的指南: