$(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'
})
});
<html>
<head>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script src='/js/fullcalendar/lib/moment.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.js'></script>
<link rel='stylesheet' href='/js/fullcalendar/fullcalendar.css' />
</head>
<body>
<div id='calendar'></div>
</body>
</html>
我想用我的刀模板添加日曆和我結束了這個錯誤。
app.js:3 Uncaught TypeError: $(...).fullCalendar is not a function(…)
我的頭部分看起來像這樣
<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script src='/js/fullcalendar/lib/moment.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.js'></script>
<link rel='stylesheet' href='/js/fullcalendar/fullcalendar.css' />
,比之後我打電話fullCalender現成事件
<script>
$(document).ready(function() {
// page is now ready, initialize the calendar...
$('#calendar').fullCalendar({
// put your options and callbacks here
})
});
</script>
隨着CDN我試圖獲取最新的jQuery和FullCalendar。
用我的代碼片段添加了/lib/moment.min.js我確認這個文件從我的本地機器加載得很好。
把你的腳本放在你的html的底部,而不是頭標記 –
@SamarRizvi我已經試過了。到目前爲止沒有運氣。 – vsoni
你能舉起一把小提琴來檢查 –