gpt4 book ai didi

php - FullCalendar JSON Feed 不起作用 : my calendar doesn't put the data from the JSON feed onto my webpage

转载 作者:行者123 更新时间:2023-12-01 04:52:56 25 4
gpt4 key购买 nike

为什么我的日历没有将 JSON Feed 中的数据放入我的网页上?

<script type='text/javascript'>
$(document).ready(function() {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
var calendar = $('#calendar').fullCalendar({
events: 'myfeed.php',
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
selectable: true,
selectHelper: true,
eventSources: [

// your event source
{
url: '/myfeed.php', // use the `url` property
color: 'red', // an option!
textColor: 'black' // an option!
}
// any other sources...
],
eventClick: function(calEvent, jsEvent, view) {
if (!confirm("Are you sure you want to delete this?")) {
}
else
{
// remove calender, and post the info to page
$.post("mybook.php", { idnumber: calEvent.id, remove: '1' } );
$('#calendar').fullCalendar('removeEvents', [calEvent.id]);
}
}
});
});
</script>

JSON Feed PHP 代码

<?php    $arr = array('id' => '1', 'title' => 'Apples', 'start' => '1372530615', 'end' => '1372537615', 'allDay' => false);
echo json_encode($arr);
?>

Charles Web 调试器显示脚本正在评估正确的页面,并且有响应。但是,我的日历什么也没做。 :( 我想这可能是因为我使用了 SSL,但我已经尝试了两种方法。

将我的代码减少到

<script type='text/javascript' src='jquery-1.9.1.min.js'></script>
<script type='text/javascript' src='fullcalendar.js'></script>
<script type='text/javascript'>
$(document).ready(function() {
var calendar = $('#calendar').fullCalendar({
events: 'myfeed.php'
});
});
</script>

JSON 提要输出

{"id":"1","title":"Apples","allDay":false,"start":"1372507615","end":"1372537615"}

最佳答案

如果您已在使用 events 属性,请删除 eventSources

关于php - FullCalendar JSON Feed 不起作用 : my calendar doesn't put the data from the JSON feed onto my webpage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17384065/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com