asciimath - Displaying ascimath using javascript -


created html with

<div id="math-display">   </div> 

next, on main.js, retrieve database using ajax , pass data in asciimath using json.mathanswer. aim display return data in asccimath mathematical expression. example: data retrieved database *dy/dx = 3*x^3*. passed json.mathanswer.

have tried using following code:

$('#math-display').append(json.mathanswer); 

or

document.queryselector('#math-display').textcontent =json.mathanswer; 

the display still in asciimath, i.e. *dy/dx = 3*x^3*.

also tried using delimiters:

$('#math-display').append(`json.mathanswer`); 

or

document.queryselector('#math-display').textcontent =`json.mathanswer`; 

the result json.mathanswer displayed in space allocated.

how display asciimath retrieved data in mathematical expression html using javascript?

the problem lies in facts many have come across , posted on stackoverflow. thank clues.

for instance:

javascript mathjax

load mathjax after loading javascript

the html parts asciimath code resides needs refresh after loading input ajax call. calling following code reload after loading ajax call.

in case, mathjax.hub.queue(["typeset",mathjax.hub, "expression"]); did job in displaying mathematical expression.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -