Re: [mathjax-users] "Uncaught ReferenceError: MathJax is not defined" and not working, but not error when I disable cache

355 views
Skip to first unread message

Davide Cervone

unread,
Mar 25, 2019, 9:34:26 AM3/25/19
to mathja...@googlegroups.com
It looks like you may have solved this, but when I first looked at your page, the script that loaded MathJax had the "async" attribute, which means that loading the file could be put off until later, after the rest of the page is loaded.  Since you have a script in the page that refers to MathJax, that script will fail if MathJax hasn't loaded yet.  That is the source of the error you were seeing.  Removing the "async" attribute means that the page will wait until MathJax is loaded before processing the rest of the page, so when your script runs later on the page, MathJax is defined.  I assume you figured this out, but am writing this so that other who might have the same problem will know the solution.

Davide


On Mar 21, 2019, at 12:13 PM, sim...@gmail.com wrote:

Hi everyone,

I am trying to learn more about programming. I am using flask and python for the first time and I want to get better at javascript.

I'm building a math game and trying to use MathJax for this. This is the link: https://tempotoets.simqne.nl/tempotoets-kww. Everything is working perfectly when I am using the Chrome developer tools and disable the cache. But when I close the developer tools it stops working and says "Uncaught ReferenceError: MathJax is not defined".

I have tried searching for this problem but I just can't figure it out. I know something must be going wrong in the timing, maybe the flask template or calling things in the wrong order. Could anyone help me with this?

Thanks,
Simone




--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages