小编Con*_*nor的帖子

使用javascript google calendar api v3从某一天获取活动

您好,我的主要目标是从谷歌日历中获取所有活动,并在下方显示其日期(如果可用的话)的名称.我正在使用javascript google calendar api v3并且遇到了抓住每个事件的日期的麻烦.在我进一步解释我的问题之前,这里是当前的代码:

var clientId = '200816328603.apps.googleusercontent.com';
var apiKey = 'AIzaSyD3rbV__d8u6r9u5GioBU0oVwa-53YXRqM';
var scopes = 'https://www.googleapis.com/auth/calendar';

function handleClientLoad() {
  gapi.client.setApiKey(apiKey);
  window.setTimeout(checkAuth,1);
  checkAuth();
}

function checkAuth() {
  gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: true},
      handleAuthResult);
}

function handleAuthResult(authResult) {
  var authorizeButton = document.getElementById('authorize-button');
  if (authResult) {
    authorizeButton.style.visibility = 'hidden';
    makeApiCall();
  } else {
    authorizeButton.style.visibility = '';
    authorizeButton.onclick = handleAuthClick;
   }
}

function handleAuthClick(event) {
  gapi.auth.authorize(
      {client_id: clientId, scope: scopes, immediate: false},
      handleAuthResult);
  return false;
}

//document.createTextNode(resp.items[i].summary)

function makeApiCall() {

  gapi.client.load('calendar', 'v3', …
Run Code Online (Sandbox Code Playgroud)

javascript google-calendar-api google-api

4
推荐指数
1
解决办法
3569
查看次数