From 6c00b9d8257486f95c04a984ae65ad21d458f415 2014-03-18 18:39:12
From: MinRK <benjaminrk@gmail.com>
Date: 2014-03-18 18:39:12
Subject: [PATCH] remove unnecessary onload hack from mathjax macro

---

diff --git a/IPython/nbconvert/templates/html/mathjax.tpl b/IPython/nbconvert/templates/html/mathjax.tpl
index 52cddbf..cdfa96d 100644
--- a/IPython/nbconvert/templates/html/mathjax.tpl
+++ b/IPython/nbconvert/templates/html/mathjax.tpl
@@ -1,4 +1,6 @@
 {%- macro mathjax() -%}
+    <!-- Load mathjax -->
+    <script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
     <!-- MathJax configuration -->
     <script type="text/x-mathjax-config">
     MathJax.Hub.Config({
@@ -18,19 +20,4 @@
     });
     </script>
     <!-- End of mathjax configuration -->
-
-    <script>
-    //  We wait for the onload function to load MathJax after the page is completely loaded.
-    //  MathJax is loaded 1 unit of time after the page is ready.
-    //  This hack prevent problems when you load multiple js files.
-
-    window.onload = function () {
-      setTimeout(function () {
-        var script = document.createElement("script");
-        script.type = "text/javascript";
-        script.src  = "https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML";
-        document.getElementsByTagName("head")[0].appendChild(script);
-      },1)
-    }
-    </script>
 {%- endmacro %}
\ No newline at end of file