Javascript needs "forcing" on latest Linux desktop version


I just updated Anki to 2.1.44 on my Linux machine (running Pop!_OS 20.10) from the .deb package on the Anki website. Now, I’m having weird issues with some cards. They all used to work great. I restarted Anki, did as many checks as I could, and I don’t think it’s my error, but easily could be.

Anyway, I have JS on a lot of cards to help study vocab and stuff. But it suddenly stopped working when I updated, except if I somehow “force” the card to reload. What I mean is, I’ll see a card without the JS running, then if I hit Edit then immediately close the Edit window, it will start working.

I will include 3 images. The first is what I see when the card opens, and the second is when I hit Edit then Esc (changing nothing). The third is the back side of the card, which should have the JS as well. And like I said, all this was working totally fine before the update.

Let me know what I should look into to help fix this.

You’ll need to adjust your scripts, as Anki >=2.1.41 will not reload the entire page, but only the parts that change (for performance reasons).

Normal function calls like fooBar() within your template should execute with each new card, but if you want to make sure:

To clarify, earlier desktop releases also dynamically updated the page; this likely broke because the way the page is updated changed. Unfortunately this is the risk of Javascript: Styling & HTML - Anki Manual

1 Like