Can external JavaScript files work on AnkiDroid?

Hi everyone,
I used <script src="_tagcanvas.min.js"></script> in my template to make a 3D tag cloud. It works perfectly on PC, but not on Android (Failed to load: _tagcanvas.min.js), even though the file is already included in the collection.media folder.
The _tagcanvas.min.js code runs fine if I paste it directly into the template.

Just wondering — do external JS files even work on Ankidroid, or did I screw something up?

1 Like

Anyone? Help? Just want to know if anyone ever succeed on external js files?

I use external scripts a lot and they do work on AnkiDroid just the same as on desktop. There’s some gotchas where JS that runs on AnkiDroid crashes on desktop but that shouldn’t stop the script import itself; if an error happens when executing the code, you don’t get “Failed to load: ..:”

I can’t think of a reason the script loading would fail. Maybe try changing the script file name to something else?

3 Likes

Hi, thanks for the help. It seems to be related to the collection.media folder itself. I had over 200,000 MP3 files in it, and after deleting the whole folder and re-syncing, the JS file has been working normally so far. My guess is that the large number of files caused some kind of indexing issue.

1 Like

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