我有一个简单的Mathjax代码:
<!DOCTYPE html>< HTML>< HEAD> < script type =“text / javascript” SRC =“HTTP://cdn.mathjax.org/mathjax/latest/MathJax.js配置= TEX-AMS -…
<!DOCTYPE html> <html> <head> <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script> <script> var ok = function () { document.getElementById('demo').innerHTML="$$10\\x^2$$" MathJax.Hub.Queue(["Typeset",MathJax.Hub]); } </script> </head> <body> <button onclick="ok()">Click</button> <p id="demo1">Within html $$10\\x^2$$</p> <p id="demo"></p> </body> </html>
结果不完全相同:/ 但是您的问题是当您动态更改数据时MathJax不会刷新。
也许看看这里: https://github.com/mathjax/MathJax/blob/master/test/sample-dynamic.html
我不知道这个lib,不能帮到你更多。