[sample] Sharing data between JavaScript and Python. ex)reviewer.card.id

AnkiWeb addon 1469353108

Demonstrates sharing data between JavaScript and Python by using mw.web.eval to pass variables, window.localStorage to persist them, and mw.web.evalWithCallback to retrieve JavaScript values.
AI-generated summary; may contain mistakes.

developer-tools

Open on AnkiWeb Ask about alternatives

AnkiWeb

Rating
0 (πŸ‘ 0 Β· πŸ‘Ž 0)
Updated
2023-05-13
Anki versions
2.1.58~
Description language
en

Maintenance

abandoned

  • Last update or commit was 1237 days before the snapshot (2023-05-13).

GitHub

No GitHub repository linked.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.502.1.58+2023-05-13
History across monthly snapshots

Loading…

Similar addons

Dynamic Fields

Generates dynamic field content during review via user-defined functions, inserted with the {{@ field_name :}} expression, and customizable or usable in JavaScript and HTML snippets.

card-templates

Rating 7 πŸ‘ 5 Β· πŸ‘Ž 2 Anki 2.1.35~ Updated 2021-08-02
Progress Bar

Displays a customizable progress bar during review sessions, tracking passed cards and resetting unless completed.

progress-trackingfork-or-reupload

Rating 201 πŸ‘ 130 Β· πŸ‘Ž 71 ⭐ 183 Anki <=2.1.26 Updated 2017-08-29
Anki JavaScript API

Provides JavaScript API commands to retrieve reviewer deck and card information, counts, flags, scheduling data, and search cards, compatible with AnkiDroid JS API.

sync-integrationdeveloper-tools

Rating 5 πŸ‘ 5 Β· πŸ‘Ž 0 ⭐ 11 Anki 2.1.40~ Updated 2021-02-19

Description

In JavaScript, there are times when you want to use some variables used in Anki. For example,) reviewer . card . id . However, sharing data between JavaScript and Python is not as simple as you might think. There are several ways to do this, but the following method is simple. Use the mw.web.eval function in Python to pass variables to JavaScript. If you have variables that you want to keep, use window.localStorage. If you want to get the value of a JavaScript variable, use mw.web.evalWithCallback.