Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

234
Vistas
El ejemplo de la API de Google Calendar no funciona en el sitio web de Wix

Probé este ejemplo de la página web Google Calendar for Developers: https://developers.google.com/calendar/api/v3/reference/calendars/insert?apix_params=%7B%22resource%22%3A%7B%22summary% 22%3A%22TEMP%22%7D%7D&apix=true#pruébelo .

Aunque funciona bien cuando se prueba desde el sitio web de Google, tan pronto como pego el código de ejemplo en mi sitio web de Wix y lo ejecuto, aparece un error. Aquí está el código, seguido del error.

 const { gapi } = require("googleapis"); /** * Sample JavaScript code for calendar.calendars.insert * See instructions for running APIs Explorer code samples locally: * https://developers.google.com/explorer-help/guides/code_samples#javascript */ function authenticate() { return gapi.auth2.getAuthInstance() .signIn({scope: "https://www.googleapis.com/auth/calendar"}) .then(function() { console.log("Sign-in successful"); }, function(err) { console.error("Error signing in", err); }); } function loadClient() { gapi.client.setApiKey("YOUR_API_KEY"); return gapi.client.load("https://content.googleapis.com/discovery/v1/apis/calendar/v3/rest") .then(function() { console.log("GAPI client loaded for API"); }, function(err) { console.error("Error loading GAPI client for API", err); }); } // Make sure the client is loaded and sign-in is complete before calling this method. function execute() { return gapi.client.calendar.calendars.insert({ "resource": { "summary": "TEMP" } }) .then(function(response) { // Handle the results here (response.result has the parsed body). console.log("Response", response); }, function(err) { console.error("Execute error", err); }); } gapi.load("client:auth2", function() { gapi.auth2.init({client_id: "YOUR_CLIENT_ID"}); });

Error: google.load no es una función

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda