这是我使用fullcalendar的第一天,我试图以json格式加载事件,但事件未加载
我制作了一个jsbin并简化了我的片段。 我的HTML是默认值:
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<link href='http://fullcalendar.io/js/fullcalendar-2.4.0/fullcalendar.css' rel='stylesheet' />
<link href='http://fullcalendar.io/js/fullcalendar-2.4.0/fullcalendar.print.css' rel='stylesheet' media='print' />
<script src='//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js'></script>
<script src='//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://fullcalendar.io/js/fullcalendar-2.4.0/fullcalendar.js'></script>
<!-- the code from the JavaScript tab will go here -->
<!-- the code from the CSS tab will go here -->
</head>
<body>
<div id='calendar'></div>
</body>
</html>
我的剧本很简单:
jQuery(document).ready(function(){
jQuery('#calendar').fullCalendar({
// put your options and callbacks here
events:'apps/data.php'
})
})
我的数据仅限:
[{title : 'event1',start : '2015-08-01'}]
我做了一个You can access by click here
的jsbin有什么见解可以看出出了什么问题?感谢..
答案 0 :(得分:0)
嗯,事实证明这是因为没有合适的json数据, 它应该:
[{"title" : "event1","start" : "2015-08-01"}]