I am trying to use the google calendar module of the fullcalendar plugin in JavaScript. When I try to download the Google calendar, the console displays:
Uncaught TypeError: Cannot read property 'applyAll' of undefined
The error occurs on line 23 gcal.js:
21| var fc = $.fullCalendar; 22| console.log($.fullCalendar); 23| var applyAll = fc.applyAll;
The console.log () I added, returns $ .fullCalendar as undefined, and then fc.applyAll also returns undefined. My JS knowledge is not good enough to fully understand what is going on in this file, and I'm not sure what is going wrong.
Here is my html:
<head> <link rel='stylesheet' href='fullcalendar/fullcalendar.css' /> <script src='fullcalendar/lib/jquery.min.js'></script> <script src='fullcalendar/gcal.js'></script> <script src='fullcalendar/lib/moment.min.js'></script> <script src='fullcalendar/fullcalendar.js'></script> <link href='style.css' rel='stylesheet' /> </head> <body> <div id='calendar'></div> </body>
My JavaScript:
$(document).ready(function() { $('#calendar').fullCalendar({ googleCalendarApiKey: 'my-api-key', events: { googleCalendarId: 'my-calendar-id' } }); });
And I downloaded the latest version of gcal.js (there seemed to be a problem with the file, and the site provided a link to the latest version).
source share