SHARE
TWEET

Untitled

a guest Jul 16th, 2012 473 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. How to make the source(path) of MathJax.js environment dependent?
  2. <script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js"></script>
  3. <script>
  4. if( !window.MathJax ) {
  5.     document.write(
  6.         '<script type="text/javascript" src="../lib/MathJax.js"></script>'
  7.     );
  8. }
  9. </script>
  10.        
  11. <script>
  12. var url= location.protocol == 'http:'?
  13.          "https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js" :
  14.          "../lib/MathJax.js";
  15. document.write(
  16.     '<script type="text/javascript" src="' + url + '"></script>'
  17. );
  18. </script>
RAW Paste Data
Top