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

681
Visualizações
Error de referencia no detectado: mi función () no está definida en HTMLButtonElement.onclick

El propósito es: cuando el usuario busque cualquier palabra clave en Google de mi sitio, se mostrará este botón. Al hacer clic en este botón se mostrará el código.

El error se muestra como:

Error de referencia no capturado: la cuenta regresiva de inicio no está definida en HTMLButtonElement.onclick

Estaba definiendo la función startcountdown antes de llamarla. ¿Alguien puede ayudarme? Muchas gracias.

 var referrer = document.referrer; ifm_list_browser = ['google.com', 'google.com.vn']; function checkFefer(f, e) { var i = 0; for (i = 0; i < e.length; i++) { if (f.indexOf(e[i]) > -1) return true; } return false; } function startcountdown() { document.getElementById('countDown40').setAttribute("style", "background: #0b1df5;border-radius: 10px;border:none;color: #ffffff;width: 59%;padding: 10px 0;text-transform: uppercase;font-weight: bold;font-size: 16px;outline: none; cursor: pointer;"); let cNode = jQuery("#references40"); let cKey = cNode.attr('code-ref'); let cCount = cNode.attr('countdown'); let counter = parseInt(cCount) || 40; var countdownCode = setInterval(function() { counter--; document.getElementById('countDown40').innerHTML = 'The code will show ' + counter + ' second' + '... Waiting...'; if (counter == 0) { document.getElementById('countDown40').innerHTML = `Your code is: ${stores[cKey]}`; document.getElementById('countDown40').setAttribute("style", "background: #ea3b7b;border-radius: 10px;border:none;color: #ffffff;width: 59%;padding: 10px 0;text-transform: uppercase;font-weight: bold;font-size: 16px;outline: none; cursor: pointer;"); clearInterval(countdownCode); return false; } }, 1000); } let stores = { 'ref48': '12344', 'ref49': 'some thing', 'ref50': 'happy polla', 'ref51': '343596', } var flagref = checkFefer(referrer, ifm_list_browser) if (flagref) { var html = '<p style="text-align:center;"><button style="background: #e81e1e;border-radius: 10px;border:none;color: #ffffff;width: 59%;padding: 10px 0;text-transform: uppercase;font-weight: bold;font-size: 16px;outline: none; cursor: pointer;" id="countDown40" get-code="true" class="coundownmobile" onclick="startcountdown(); this.onclick=null;">Get code</button></p>'; jQuery(document).ready(function($) { $("#references40").empty(); html = $.parseHTML(html); $("#references40").append(html); }); }
 <div id="references40" code-ref="ref51" countdown="8" style="text-align: center; font-weight: 600;"> Button will appear when search in Google </div>

about 4 years ago · Santiago Trujillo
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