简体   繁体   中英

How can I make MathJax render correctly within this script?

I'm currently trying to learn JavaScript (since yesterday). As my first project, I attempted to write a program to solve quadratic equations with real roots. This can be seen here:

http://mathematicool.net/solve-quadratic.html

However, MathJax doesn't seem to be being applied to the code, since adding $ signs into this script does not express things in LaTex. What should I do to make it work correctly?

You have to run MathJax after outputting the equation. This is one way of doing that:

 MathJax.Hub.Queue(['Typeset', MathJax.Hub, document.getElementById(<ID OF DOM ELEMENT>)]);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM