# How do you debug javascript in your cards?

**URL:** <https://forums.ankiweb.net/t/how-do-you-debug-javascript-in-your-cards/24752>\
**Category:** Card Design\
**Created:** [November 18, 2022, 12:43am UTC](https://forums.ankiweb.net/t/how-do-you-debug-javascript-in-your-cards/24752 "2022-11-18T00:43:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ganqqwerty](https://avatars.discourse-cdn.com/v4/letter/g/50afbb/32.png) [@ganqqwerty](https://forums.ankiweb.net/u/ganqqwerty)\
**Post date:** [November 18, 2022, 12:43am UTC](https://forums.ankiweb.net/t/how-do-you-debug-javascript-in-your-cards/24752/1 "2022-11-18T00:43:26Z")

</div>

The smartest thing I came up to so far is to copy the text from the card template and open it as an html file in my IDE. Unfortunately, I need to use mocked data for the fields, also there’s no Anki to generate an input for my free-form answer cards.

I wonder if someone came up with better solution.

Also, another question: how do you test if your card with JS will work on mobile platforms? Which browser is used inside AnkiDroid, AnkiOSX, AnkiWindows, AnkiLinux, and Anki for iPhone?

---

<div class="post-metadata">

**Author:** ![jambamboleo](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jambamboleo](https://forums.ankiweb.net/u/jambamboleo)\
**Post date:** [November 18, 2022, 8:21am UTC](https://forums.ankiweb.net/t/how-do-you-debug-javascript-in-your-cards/24752/2 "2022-11-18T08:21:04Z")

</div>

[AnkiWebView Inspector](https://ankiweb.net/shared/info/31746032)

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [November 18, 2022, 10:38am UTC](https://forums.ankiweb.net/t/how-do-you-debug-javascript-in-your-cards/24752/3 "2022-11-18T10:38:24Z")

</div>

> [@ganqqwerty](#):
>
> Also, another question: how do you test if your card with JS will work on mobile platforms? Which browser is used inside AnkiDroid, AnkiOSX, AnkiWindows, AnkiLinux, and Anki for iPhone?

No substitute for testing on real devices. I’ve had issues with even simple templates with basic JS not working properly on mobile for example.

But knowing the browsers/web engines used on each platform is definitely helpful if you want to see if some feature you want to use is supported everywhere ([MDN](https://developer.mozilla.org/en-US/) and [caniuse](https://caniuse.com/) are popular resources for that). The following web engines are used on each platform:

- Anki Desktop (all desktop platforms): Chromium. See [Qt WebEngine Overview | Qt WebEngine 6.6.1](https://doc.qt.io/qt-6/qtwebengine-overview.html) for details.
- AnkiDroid: I think it’s based on Chromium too. See [https://developer.chrome.com/docs/multidevice/webview/](https://developer.chrome.com/docs/multidevice/webview/)
- AnkiMobile (iPhone and iPad): WebKit

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [December 18, 2022, 10:38am UTC](https://forums.ankiweb.net/t/how-do-you-debug-javascript-in-your-cards/24752/4 "2022-12-18T10:38:24Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
