sample-loader.html 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Load MathJax after the page is ready</title>
  5. <!-- Copyright (c) 2012-2013 The MathJax Consortium -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  8. <script type="text/javascript">
  9. //
  10. // We wait for the onload function to show that MathJax is laoded after
  11. // the page is ready, and then use setTimeout to prove that MathJax is
  12. // definitely loaded after the page is displayed and active. MathJax is
  13. // loaded two seconds after the page is ready.
  14. //
  15. window.onload = function () {
  16. setTimeout(function () {
  17. var script = document.createElement("script");
  18. script.type = "text/javascript";
  19. script.src = "../MathJax.js?config=TeX-AMS-MML_HTMLorMML";
  20. document.getElementsByTagName("head")[0].appendChild(script);
  21. },2000)
  22. }
  23. </script>
  24. <style>
  25. h1 {
  26. text-align: center;
  27. background: #CCCCCC;
  28. padding: .2em 1em;
  29. border-top: 3px solid #666666;
  30. border-bottom: 3px solid #999999;
  31. }
  32. </style>
  33. </head>
  34. <body>
  35. <h1>Adding MathJax After the Page is Loaded</h1>
  36. <p>
  37. When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are
  38. $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
  39. </p>
  40. </body>
  41. </html>