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

342
Vistas
'showPDF' is declared but its value is never read

some background information: i have a button in my html file that should activate the showPDF function but it tells me that its value is never read

picture of the error message

javascript:

HM.PDFViewer = 
{
    init: function()
    {
        //---
    },
    showPDF: function()
    {
        function showPDF(x) {
            x.style.display = "none";
            var embed = document.createElement("EMBED");
            embed.setAttribute("src", "/pdf/Doku.pdf");
            embed.classList.add("size");
            document.body.appendChild(embed);
          }
    },
};

the button in my html looks like this:

<button type="button" id="show" onclick="showPDF(this)" >PDF anzeigen</button>

help would be greatly appreciated as i can't seem to find any answers in different questions

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

0

You just need to remove the duplication of the showPDF function. you don't need the inner one.

showPDF: function()
{
        x.style.display = "none";
        var embed = document.createElement("EMBED");
        embed.setAttribute("src", "/pdf/Doku.pdf");
        embed.classList.add("size");
        document.body.appendChild(embed);
},
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