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: