3

I would like to apply the jqMath script after the initial page load.

The problem I have is that I make an ajax call which retrieves some jqMath syntax and loads it into a div section of the main page.

However the syntax is not currently being parsed. How do I ensure jqMath can be triggered when the ajax call returns and applied to the appropriate div section ?

VividD
  • 10,456
  • 6
  • 64
  • 111
dky
  • 35
  • 4

2 Answers2

3

Call M.parseMath(myDiv); after loading myDiv.

For example, jqMath automatically does M.parseMath(document.body); after the initial page load.

Dave Barton
  • 1,429
  • 13
  • 12
  • Look, I'm trying to use [your library](http://mathscribe.com/author/jqmath.html) but I cannot implement it .. May you please help me? Is there any reference on github to explain how can I implement it? – stack Feb 06 '16 at 14:03
  • It's not on github (at least not yet). The main documentation is at http://mathscribe.com/author/jqmath.html. After you read and experiment there, click the "download jqMath" link in the middle of that page and then read the COPY-ME.html file. If you have a specific question after that, post a question to stackoverflow. If you're working on Android, see http://stackoverflow.com/questions/30263725/how-do-i-install-jqmath-on-android. – Dave Barton Feb 07 '16 at 21:49
2

The above might fail to work if you use a global variable M for something other than jqMath. The work-around is to call jqMath.parseMath(element); for example jqMath.parseMath(document.body);

Dave Barton
  • 1,429
  • 13
  • 12