Refreshing Javascript on the page without refreshing HTML

后端 未结 1 1076
轮回少年
轮回少年 2021-01-25 07:47

A little context on my problem. I am updating the MathML in this div that is currently displaying HTML. When I load the page the first time, if runs the MathJax script and displ

相关标签:
1条回答
  • 2021-01-25 08:35

    MathJax.Hub.Typeset() is the JavaScript command that can re-render the math content within your page or within individual elements that have been updated by current changes. If you are sure that all typesetting is finished, then you can call it directly, but in general it is good to use the safe way to call it, like this MathJax.Hub.Queue(["Typeset",MathJax.Hub]);

    Read more instructions for how to use it here: http://docs.mathjax.org/en/v1.1-latest/typeset.html

    For instance, MathJax.Hub.Queue(["Typeset",MathJax.Hub,"previewdiv"]); would re-render the updated contents of the HTML element with an ID of previewdiv after you have updated its contents using your jQuery call.

    0 讨论(0)
提交回复
热议问题