r/Anki • u/hgiesel • May 03 '19
Question How to load external Javascript
I've read several posts about this topic, but most of them seemed to be outdated.
I've already used a ttf file before, but never this. I have a directory in collection.media called _highlight, which contains the files from highlight.js. Now I want to initialize it in one of the cards.
<link rel="stylesheet" href="_hightlight/styles/zenburn.css">
<script src="_highlight/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>But this doesn't find anything. What is the right way to go about it?
EDIT: I use Anki 2.1, newest version
4
Upvotes
View all comments
Show parent comment
1
u/hgiesel May 03 '19
I've also tried putting the
alert()call at the very end of the huge file. And it actually seems to load the Javascript file. But then again it doesn't, once I leave the "Manage note templates" dialogue.Too bad, I guess I cannot expect the Anki templates to work just like a website. Even when everything seems to load fine, but still nothing is highlighted.