单击按钮JavaScript加载MathJax

时间:2019-05-10 06:21:53

标签: javascript jquery html css mathjax

我正在使用隐藏的输入值在 html 上预取公式,我正在使用 MathJax 脚本,开始加载MathJax来触发。但是公式是在html隐藏标记上预取的,因此我创建的按钮公式的按钮..on-click将显示在html主体上。该过程MathJax不会在JavaScript上触发。

当我调用JavaScript MathJax触发时,正在执行MathJax页面的加载

我希望3/2的输出将使用MathJAx 3/2,但实际输出是3/2

window.MathJax = {
        "fast-preview": {
                disabled: true
        },
        AuthorInit: function() {
            MathJax.Hub.Register.StartupHook('End', function() {
                MathJax.Hub.processSectionDelay = 0
                var demoSource = document.getElementById('question_content')
                var demoRendering = document.getElementById('question_content')
                var math = MathJax.Hub.getAllJax('question_content')[0]
                demoSource.addEventListener('input', function() {
                    MathJax.Hub.Queue(['Text', math, demoSource.value])
                })
            })
        }
    }

我在加载时使用了上面的代码...但是单击按钮后无法正常工作

0 个答案:

没有答案