How do I format html with MathJax after loading it using jQuery.load?

Viewed 3257

I am loading a new page with jQuery.load. However, the contents are being treated weirdly somehow. On the original page, I have some code to format latex commands with MathJax:

<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>

And this works fine for the original file. However, when I click on my link and insert more HTML into the page:

<script>
  $(document).ready(function(){
    $("#link").click(function(){
      $("#myDiv").load("test.html");
    });
  });
</script>

Now the special characters are not formatted by MathJax and are just displayed as-is.

2 Answers
Related