“Uncaught SyntaxError: Unexpected token .” with FullCalendar

It’s a .css file, which means it’s a Cascading Stylesheet and not a script. You want a <link> tag rather than a <script> one.

<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/1.6.4/fullcalendar.css"/>

Attempting to load it using a <script> tag results in your CSS being interpreted as JavaScript, and throwing the error because it’s invalid. You can’t use a . at the start of a JavaScript identifier so it’s not expecting to find one at that position in the “code”.

Leave a Comment

tech