In order to dynamically enter content on a webpage without resorting to off-line rendering, I used MathJax to display content.
The javascript for MathJax is at
https://github.com/mathjax/MathJax/blob/master/MathJax.js
with instructions for use here
https://docs.mathjax.org/en/latest/configuration.html
I was able to get a page that accepts input and renders Latex input:
http://allofphysicsgraph.github.io/proofofconcept/site/mjtest
Source code for the page is here:
https://github.com/allofphysicsgraph/proofofconcept/blob/gh-pages/site/mjtest.html
Next I ran scaling tests for latency as a function of the number of rendered expressions in Chrome.
25 expressions:
- http://allofphysicsgraph.github.io/proofofconcept/site/mjtest_scaling_25
- DOMContentLoaded: 203 ms; Load: 516 ms; Finish: 835 ms
- http://allofphysicsgraph.github.io/proofofconcept/site/mjtest_scaling_50
- DOMContentLoaded: 202 ms; Load: 548 ms; Finish: 977 ms
- http://allofphysicsgraph.github.io/proofofconcept/site/mjtest_scaling_100
- DOMContentLoaded: 220 ms; Load: 538 ms; Finish: 1140 ms