我正在尝试下面的代码..集成全日历:-
<doctype! html>
<html lang="urf-8">
<head>
<title>Full calendar</title>
<link rel="stylesheet" href="fullcalendar.css"/>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css"/>
<script type='text/javascript' src='jquery.js'></script>
<script type='text/javascript' src='fullcalendar.js'></script>
<script>
$(document).ready(function() {
$('#cal').fullCalendar({
// put your options and callbacks here
theme: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay,agendaWeek,agendaDay'
},
editable: false,
events: "json-events.php",
})
});
</script>
</head>
<body>
<div id="cal" ></div>
</body>
</html>
Json-events.php 代码:-
<?php
include("connect.php");
$query = "select * from calendar";
$res = mysql_query($query) or die(mysql_error());
$events = array();
while ($row = mysql_fetch_assoc($res)) {
$eventsArray['id'] = $row['calendar_id'];
$eventsArray['title'] = $row['subject'];
$eventsArray['start'] = mktime($row['start_date_time']);
$events[] = $eventsArray;
}
echo json_encode($events);
?>
为了在我访问 json-events.php 时进行调试,我得到了结果,但在 fullcalendar 中没有显示任何事件。
请帮我..