Trying to upload a Bootstrap calendar to my page. Getting Unhandled Error

The exact error I get is "Sewage Error: Calendar: Event Download URL Not Set." I exactly follow the instructions https://github.com/Serhioromano/bootstrap-calendar . I'm just trying to download this thing, so I have an empty body with the line <div id="calendar"></div> , and my javascript contains var calendar = $('#calendar').calendar(); . However, when the page loads, nothing is displayed, and the above error is displayed in my console, pointing to a javascript line. I'm really not quite sure what to do.

+4
source share
1 answer

The documentation is a bit misleading.

To run a demo:

  • You need to provide a source of events. You can give it a dummy event source with events_source: function () { return []; } events_source: function () { return []; } .
  • You have to copy
    • calendar.min.js (or calendar.js)
    • calendar.min.css (or calendar.css)
    • Tmpls folder
  • You have to download javascript jQuery files, then Bootstrap , then Underscore.js , and then the calendar in that order.
  • It is recommended that you specify the tmpls path.

HTML example

 <script src="/Scripts/jquery.min.js"></script> <script src="/Scripts/bootstrap.min.js"></script> <script src="/Scripts/underscore-min.js"></script> <script src="/Scripts/calendar.min.js"></script> ... <div id="calendar"></div> 

Javascript example

 <script type="text/javascript"> var calendar = $("#calendar").calendar( { tmpl_path: "/tmpls/", events_source: function () { return []; } }); </script> 
+5
source

Source: https://habr.com/ru/post/1494123/


All Articles