Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

340
Visualizações
'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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda