Skip to content

Instantly share code, notes, and snippets.

@andersonfreitas
Created October 9, 2012 02:10
Show Gist options
  • Save andersonfreitas/3856171 to your computer and use it in GitHub Desktop.
Save andersonfreitas/3856171 to your computer and use it in GitHub Desktop.
Loading MathJax Dynamically
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://cdn.mathjax.org/mathjax/latest/MathJax.js"; // use the location of your MathJax
var config = 'MathJax.Hub.Config({' +
'extensions: ["tex2jax.js"],' +
'jax: ["input/TeX","output/HTML-CSS"]' +
'});' +
'MathJax.Hub.Startup.onload();';
if (window.opera) {script.innerHTML = config}
else {script.text = config}
document.getElementsByTagName("head")[0].appendChild(script);
})();
@andersonfreitas
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment