加载html后的LaTeX公式

时间:2016-01-09 12:29:32

标签: javascript jquery html latex mathjax

我想在使用

后加载script Mathjax
( 'div#someone' ).load( "http source" )

实际上,当页面在标题中完全加载时,它可以正常工作。

<script class="mathlab" type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [["$","$"], ["\\(","\\)"]]}});</script>
<script class="mathlab" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

任何人都知道如何在加载后刷新脚本?或者也许是另一个剧本?

&#13;
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>



<script type="text/javascript">
    $("button").click(function() {
         $("div").text( "Hello ! What is $x$ in the formula : $$x+3=7$$" );
    });
</script>
&#13;
Hello ! What is $x$ in the formula : $$x+3=7$$
<div> <button>Load something</button> </div>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

添加

$( "div#someone" ).load( "http source", function () {
    MathJax.Hub.Queue(["Typeset", MathJax.Hub, "div#someone"]);
});