You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google Calendar API加载异常:iframe加载日历时报错求助(已解决)

Google日历Web应用加载报错问题

我正在开发一款可查看Google账户日历的Web应用,日历通过iframe嵌入在主页面(index.html)中,点击按钮触发加载逻辑。点击加载按钮后,控制台两次抛出以下错误:

Error signing in to Google: Error: The Google API has not been loaded correctly.
at showGoogleCalendar (calendar2/:119:12)
at HTMLButtonElement.onclick (calendar2/:245:62)
showCalendarGoogle @ calendar2/:145
onclick @calendar2/:245

报错对应的代码位置:

  • Calendario2/:145(即showGoogleCalendar()函数)
  • Calendario2/:178(即handleError()函数)

已完成的配置:在Google Cloud Platform中启用了Google Calendar API,并且正确配置了API密钥、OAuth 2.0客户端ID及重定向URL。

注:已通过Twilight的评论解决该问题


内容的提问来源于stack exchange,提问作者Hugo Jiménez

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 23:32:34