完整的日历不显示任何谷歌日历事件
问题描述:
我发表了这个问题前一整天都在研究,并没有运气。因此,我现在要求一些帮助!完整的日历不显示任何谷歌日历事件
我无法使用FullCalendar将我的任何Google日历活动显示在我的网站上。不仅我的活动没有显示,我甚至无法让美国假期日历显示,就像他们在FullCalendar上的演示一样。
我希望我失去了一些非常小的东西,并且有人能够很快赶上它。日历本身显示正确,但没有事件显示。
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>tegIdeas - Course Schedule</title>
<meta name="description" content="">
<link rel="icon" type="image/x-icon" href="favicon.ico"/>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/prettyPhoto.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/fullcalendar.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<link href="css/responsive.css" rel="stylesheet">
<link href="css/shame.css" rel="stylesheet">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.isotope.min.js"></script>
<script src="js/moment.min.js"></script>
<script src="js/main.js"></script>
<script src="js/fullcalendar.min.js"></script>
<script src="js/gcal.js"></script>
<script type='text/javascript'>
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
eventSources: {
googleCalendarApiKey: 'myApiKey',
googleCalendarId: 'myCalendarId',
className: 'fc-event-email'
},
selectable: true,
selectHelper: true,
editable: false,
});
});
</script>
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
答
这可能是一个虚拟question-您是否使用了正确的apiKey和calendarId代替'myApiKey'
和'myCalendarId'
?
此外,如果'myApiKey'
和'myCalendarId'
是您先前在您的代码中设置的变量,则不应该由'
扭曲。
eventSources: {
googleCalendarApiKey: myApiKey,
googleCalendarId: myCalendarId
}
答
结束不必要的逗号
你可以重新写为下面的日历功能:
- 到位eventSources的只是事件
- 注意在的
editable: false
结束不必要的逗号
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
googleCalendarApiKey: 'API_Key',
events: {
googleCalendarId: 'Calendar_Id'
},
selectable: true,
selectHelper: true,
editable: false
});
这工作 为了我。
为了提出这个问题,我只是用占位符替换了它们。事实上他们并不是变数,那就是我习惯写东西的方式! –
对不起。我只需要问......:c) – ThiagoPXP
其他事情:你是通过本地主机还是文件系统运行网页(如file:// c:etc)......如果没有在htttp下运行, https – ThiagoPXP