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

207
Vistas
Why is the html script not getting the list from my code.gs file

I am working on a youtube sort of thingy but I've been testing it and it doesn't paste the youtube titles into the custom dialog. I have 2 files. Code.gs and youtube.html. Here are the files
Code.gs

function youtube(input1){
  const list = []
  const sr = YouTube.Search.list("snippet", {q: input1, maxResults: 50})
  sr.items.forEach(function(vid){
    list.push(vid.snippet.title)
  })
  return list
}

youtube.html

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
  </head>
  <body>
    <button onclick="printData()">Return</button>
    <script>
      function printData(){
        const list = google.script.run.youtube("test")
        document.write(list)
      }
    </script>
  </body>
</html>

When I run it, it just does nothing when I click the button

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

<script>
      function printData(){
        const list = google.script.run
        .withSuccessHandler((list) => document.write(list))
        .youtube("test")
      }
</script>

success handler

about 4 years ago · Juan Pablo Isaza Denunciar
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