Anki Forums

More serious bugs

Duplicate loading of binding events

The js script will load repeatedly. If there is a click event, the click event on the back will be executed twice, and if there is a post, the post will be executed many times. Previous versions will not be like this, and Android and computer versions will not have such problems. Please fix it as soon as possible. Thank you.

Simple code:

Click to show hidden

{{Front}}
                <script src="_jquery.js"></script>

If you put a script tag in a card template, it will be evaluated each time the card template is shown, and the computer version should behave in the same way. If you are performing changes in JS that you only want to happen once, you can set a global variable, and then only execute your code if it is not already set.

好的,谢谢!