ASCIIMath with XMLHttpRequest

52 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Dan Healy

ungelesen,
07.08.2013, 11:59:0407.08.13
an asci...@googlegroups.com
When I view a page with ASCIIMath text, the formulas are rendered as expected.  When I execute an XMLHttpRequest and bring in more ASCIIMath text, the formulas are not rendered as expected.  They just appear as straight ASCII text.  How do I caused the new formulas to be displayed?

Thanks,

Dan H

David Lippman

ungelesen,
07.08.2013, 12:48:0807.08.13
an asci...@googlegroups.com
AM adds an onload event that translates the page when it's initially loaded.  On ajax requests, you have to manually trigger the re-render.  Do this by calling the AMprocessNode function, feeding it the element that contains the new text to be rendered.  For example,

targetel = document.getElementById(target);
targetel.innerHTML = req.responseText; 
AMprocessNode(targetel);

The process is different if you're using MathJax, but since you posted here, I'm assuming you're using the classic AsciiMathML script.

David


--
You received this message because you are subscribed to the Google Groups "ASCIIMath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asciimath+...@googlegroups.com.
To post to this group, send email to asci...@googlegroups.com.
Visit this group at http://groups.google.com/group/asciimath.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


Dan Healy

ungelesen,
07.08.2013, 13:15:0307.08.13
an asci...@googlegroups.com
You are right, I am in the wrong place.  I am using MathJax to render ASCIIMathML in any browser, per your recommendation, and that is working well.  I will pose this question to the MathJax group.

Thanks, Dan H

David Lippman

ungelesen,
07.08.2013, 13:38:5607.08.13
an asci...@googlegroups.com
As I recall, the equivalent in MathJax is:

MathJax.Hub.Queue(["Typeset", MathJax.Hub, node]); 

where node is the element to be rendered.

Dan Healy

ungelesen,
07.08.2013, 22:55:4307.08.13
an asci...@googlegroups.com
Typeset works.  Another problem bites the dust.  Thank you very much.

Dan H
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten