php - Loading MathJax into loaded div -
It is not entirely certain how the phrase of this question is.
I have a website that uses MathJax to display math problems. The text on a page is filled with different files that someone searches for. So, for example, the search for 'apple' brings the page to 'apples' This text is stored in a class in another PHP file, and the math equation is also typed there. However, once I load the equation in the page, it does not type in:
& lt; Script type = "text / javascript" src = "https: //c328740.ssl.cf1? .rackcdn.com / mathjax / latest / MathJax.js config = Tex-Ams-MML_HTMLorMML" & gt; Function companium () {document.getElementById ('title'). InnerHTML = '& lt ;? Php echo $ pageTitle? & Gt; '; Document.getElementById ('body'). InnerHTML = '& lt ;? Php link ($ page body, $ new_classes)? & Gt; '; Document.getElementById ('nav'). InnerHTML = '& lt ;? Php echo $ pageNav? & Gt; '; } & Lt; / Script & gt; & Lt; Script type = "text / x-mathjax-config" & gt; MathJax.Hub.Config ({tex2jax: {displayMath: [['[mathematics]', '[mathematics]']]}}); & Lt; / Script & gt; I'm not completely sure what to do, but I want to type it once it gets loaded. Does anyone know what I can do to do this? The equation is stored in a class in a secondary file as a variable, and it is printed. Which does this, however it will not do the typeet
Every time you load new content JavaScript Function Function Update_mathJax () {MathJax.Hub.Queue (['typeset', MathJax.Hub, 'body']); } Here 'body' can be replaced by any Div's ID that you want to update so that you can do something like this function updates_mathJack {ID} {MathJax.Hub.Queue (['typeset', MathJax.Hub, id]); } then call update_mathjax ('body') or update_mathjax ('title') . They remember the div id, are not HTML elements, I'm not sure that using element names will work themselves, but I do not think so ...
Comments
Post a Comment