如何使用javascript更新Google日历中的活动? [英] How to update an event in Google Calendar using javascript?

查看:124
本文介绍了如何使用javascript更新Google日历中的活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要更新一些Google日历活动的名称,一旦我通过JavaScript获取它们。我只有Google在其Google Developer网站上显示的示例代码,而我找不到Google Calendar API方法列表以在JavaScript中使用它们。我只在API Reference中看到REST请求。对不起我的英文,谢谢。

I need to update the name of some Google Calendar events, once I get them through JavaScript. I only have the sample code which Google shows in their Google Developer site, and I cannot find a Google Calendar API methods list to use them in JavaScript. I only see REST requests in the API Reference. Sorry my english, thanks.

推荐答案

您必须执行HTTP(PUT)请求。这可以通过AJAX或jQuery.ajax()完成:

You have to perform an HTTP (PUT) Request. This could maybe done be done with AJAX or jQuery.ajax():

jQuery.ajax

//This is the event data you got, with the changed values, you want to be changed in Calendar API
var changedEventData;

//changing the data of an calendar event
$.ajax({
  url: "https://www.googleapis.com/calendar/v3/calendars/" + calendarId + "/events/" + eventId,
  method: "PUT",
  data: changedEventData
});

请记住实施 jQuery

我希望这适合你!

这篇关于如何使用javascript更新Google日历中的活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆