Gapi.load vs gapi.client.load

In the JavaScript JavaScript API, what's the difference between gapi.load () and gapi.client.load ()? How much are they interchangeable and when should I use them against each other? I can see that both of them are used in the Google Drive Realtime API Sample Code.

+8
javascript google-drive-realtime-api
source share
1 answer

As the CORS documentation points out, gapi.load used to dynamically load specific JavaScript libraries.

As described in the description of the gapi.client.load function (which is provided by the "client" JS library), gapi.client.load used to create a JavaScript interface for accessing certain HTTP (S) APIs; You can also do this yourself using the API search (look for it to search for documents) and send API requests directly using gapi.client.request or CORS.

Edit: Added clarification based on Brian Slezinsky after the comments and minor wording changes.

+8
source share

All Articles