Skip to content Skip to sidebar Skip to footer

Refreshing Javascript On The Page Without Refreshing Html

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 displays

Solution 1:

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.

Post a Comment for "Refreshing Javascript On The Page Without Refreshing Html"