「Mathjax2.x 練習場」の版間の差分
編集の要約なし タグ: 手動差し戻し |
編集の要約なし |
||
32行目: | 32行目: | ||
$$ \require{physics} \flatfrac{1}{2} $$ | $$ \require{physics} \flatfrac{1}{2} $$ | ||
<div id="output"></div> | |||
<div id="version"></div> | |||
<freescript></script> | |||
<script type="text/javascript"> | |||
// 読み込み後にグローバルスコープのオブジェクトを調べる | |||
window.onload = function() { | |||
const keys = Object.keys(window).sort(); // グローバル変数を列挙 | |||
const output = keys.includes("MathJax") ? "MathJax is defined." : "MathJax is not defined. Global keys: " + keys.join(", "); | |||
document.getElementById("output").textContent = output; | |||
if (typeof MathJax !== "undefined") { | |||
if(MathJax.version) { | |||
// MathJax のバージョンを取得して表示 | |||
document.getElementById("version").textContent = "MathJax version: " + MathJax.version; | |||
} | |||
} else { | |||
console.error("MathJax is not defined or failed to load."); | |||
document.getElementById("version").textContent = "MathJax failed to load."; | |||
} | |||
}; | |||
</script> | |||
<script></freescript> |