试图了解我应该如何为静态页面网络应用程序引用 google api。我很困惑。
- 我不确定完整的文档在哪里,因为我已经在这个存储库中偶然发现了一些损坏的链接
- 这些教程引用了 2 个不同的 url,但似乎与此相关 repository
https://developers.google.com/identity/sign-in/web/reference#gapiauth2initparams
<script src="https://apis.google.com/js/platform.js?onload=init" async defer></script>
https://developers.google.com/sheets/api/quickstart/js
<script async defer src="https://apis.google.com/js/api.js"
onload="this.onload=function(){};handleClientLoad()"
onreadystatechange="if (this.readyState === 'complete') this.onload()">
有什么区别?应该使用什么网址?有关系吗? 是否应该使用节点客户端而不是 Web 来编译它?
最佳答案
https://github.com/google/google-api-javascript-client/issues/658#issuecomment-692839901
sergentj 评论
The functionality in platform.js is a superset of the functionality in api.js. The documentation for those APIs is correct. If you are using both the sheets APIs and the sign-in API, platform.js will suffice, you needn't load both. You are correct that this is poorly documented, and we're aware that's a problem. Closing this since it is not going to be useful to track work on improving documentation (which is a much larger issue) here.
关于javascript - platform.js 还是 api.js?谷歌API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63039221/