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

342
Visualizações
Anki: How to load javascript file at first question?

I've put the following _mydeck.js file in the collection.media/ folder:

var count = ++count || 1

if (count == 1) {
  var niverennou = niverennou || [
    "zero", "unan", "daou", "tri", "pevar",
    "pemp", "c'hwec'h", "seizh", "eizh", "nav", "dek"
  ];
}

Then, in the question (Front) of a card of my deck, I have:

<script src="_mydeck.js"></script>

{{Kentel}}
<div id="kentel"></div>

<div id="debug">0</div>

<script>

// Javascript File Loading Count
document.getElementById("debug").innerHTML = count;

// Lessons number in letters
document.getElementById("kentel").innerHTML = niverennou[{{Kentel}}];

</script>

When a first card's question is displayed, the debug counter shows 0 meaning that the javascript file is not yet loaded. Then when showing the answer and further cards, the debug counter is incremented and the kentel variable is properly set.

How can I have the javascript file taken into account as soon as the first card's question is loaded ?

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