Uncaught TypeError: $(…).fullCalendar is not a function(…)

后端 未结 3 584
孤街浪徒
孤街浪徒 2021-01-26 02:32



        
相关标签:
3条回答
  • 2021-01-26 03:07

    Include your script after including your jquery library

        <html>
          <head>
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
            <script src="https://momentjs.com/downloads/moment.min.js"></script>
            <script src='https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.js'></script>
            <link rel='stylesheet' href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.css" />
            </head>
          <body>
             <div id='calendar'></div>
    
            <script>
                $(document).ready(function() {
    
                // page is now ready, initialize the calendar...
    
                $('#calendar').fullCalendar({
                    // put your options and callbacks here
                    left:   'Calendar',
                    center: '',
                    right:  'today prev,next'
                    });
    
                });
            </script>
          </body>
          </html>

    0 讨论(0)
  • 2021-01-26 03:19

    Where is your jquery ui and you need to run scripts at the bottom and css at top.

    Codepen Demo http://codepen.io/norcaljohnny/pen/OWLjaX

    <head>
    <link rel='stylesheet' href='https://fullcalendar.io/js/fullcalendar-3.1.0/fullcalendar.min.css' />
    </head>
    
    <body>
    <div id='calendar'></div>
    
    <script src='https://fullcalendar.io/js/fullcalendar-3.1.0/lib/moment.min.js'></script>
    <script src='https://fullcalendar.io/js/fullcalendar-3.1.0/lib/jquery.min.js'></script>
    <script src='https://fullcalendar.io/js/fullcalendar-3.1.0/lib/jquery-ui.min.js'></script>
    <script src='https://fullcalendar.io/js/fullcalendar-3.1.0/fullcalendar.min.js'></script>
    </body>
    

    This is the sample source from the developer.

    > <meta charset='utf-8' /> <link href='../fullcalendar.min.css'
    > rel='stylesheet' /> <link href='../fullcalendar.print.min.css'
    > rel='stylesheet' media='print' /> <script
    > src='../lib/moment.min.js'></script> <script
    > src='../lib/jquery.min.js'></script> <script
    > src='../lib/jquery-ui.min.js'></script> <script
    > src='../fullcalendar.min.js'></script> <script>
    
    0 讨论(0)
  • 2021-01-26 03:24

    I appreciate all for your time taking to help me out here. I found that I have got other .js file resides at the bottom of the page which causes this issue. I commented out that .js and I got the calendar showing on my blade template. Thanks all.

    0 讨论(0)
提交回复
热议问题