尝试使用Java Script从Google API显示日历列表

1 javascript api ajax calendar

我有些麻烦通过Google API显示来自Google日历的可访问日历列表.我使用JavaScript和AJAX.

我需要使用哪些方法?我只找到了与事件有关的方法,但没有找到日历的显示说明.

谢谢!

Aks*_*hay 7

要获得基本工作模型,您可以按照日历API网站上的快速入门示例进行操作

该示例有一个名为listUpcomingEvents()的函数来获取"主"日历上的事件.要获取日历列表,请使用以下方法:

function listCalendars()
{
     var request = gapi.client.calendar.calendarList.list();

     request.execute(function(resp){
             var calendars = resp.items;
             console.log(calendars);
     });
}
Run Code Online (Sandbox Code Playgroud)

  • 你在哪里找到关于`gapi.client.calendar.calendarList.list`的文档?[参考文档](https://developers.google.com/google-apps/calendar/v3/reference/calendarList/list)仅显示Java,Python,PHP和Ruby以及[JS Docs](https:// developers.google.com/api-client-library/javascript/reference/referencedocs)没有提及日历. (5认同)