sample-loader.html 1.3 KB

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