我的日历运行良好,但它无法连接到我制作的公开测试Google日历。我已经完成了两次所有步骤,以确保我没有错过任何东西。我知道它正确连接,因为当我更改API密钥时它会抛出错误。在我的谷歌开发者短信中,我可以看到对数据的请求,但他们没有在实际的Fullcalendar中显示。检查器控制台中没有错误。任何将FullCalender与gcal联系起来的人都可以了解我所缺少的内容吗?这是完整的代码:
<!DOCTYPE html>
<html>
<head>
<!--
Customize this policy to fit your own app's needs. For more guidance, see:
https://github.com/apache/cordova-plugin-whitelist/blob/master/README.md#content-security-policy
Some notes:
* gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
* https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
* Disables use of inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
-->
<meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;style-src * 'unsafe-inline' 'self' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval'; media-src *; img-src 'self' data: content:;">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link rel="stylesheet" type="text/css" href="css/index.css">
<title>Hello World</title>
<link rel="stylesheet" href="fullcalendar.css"/>
<script src="lib/jquery.min.js"></script>
<script src="lib/moment.min.js"></script>
<script src="fullcalendar.js"></script>
<script type="text/javascript" src="gcal.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#calendar').fullCalendar({
googleCalendarApiKey: 'AIzaSyAq_BYJLX78-t4Xn6g4wZouE0D1_I5HJlM',
events: {
googleCalendarId: 'pcr0c6flf63fc80in0eua7amd8@group.calendar.google.com',
className: 'gcal-event' // an option!
}
});
});
</script>
</head>
<body>
<div id="calendar"></div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
</body>
</html>
<!-- <div class="app">
<h1>Apache Cordova</h1>
<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p>
</div>
</div>
-->