s4

changeset 945:29342754a2d0

Catch undefined error when MathJax not loaded
author HIROSE Yuuji <yuuji@gentei.org>
date Mon, 25 Oct 2021 23:25:56 +0900
parents 3891edb19b0b
children 420ad90116e6
files s4-main.js
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/s4-main.js	Mon Oct 25 23:14:53 2021 +0900
     1.2 +++ b/s4-main.js	Mon Oct 25 23:25:56 2021 +0900
     1.3 @@ -176,9 +176,11 @@
     1.4  	    }, 100);
     1.5  	    cnt++;
     1.6  	}
     1.7 -	if (MathJax && MathJax.typesetPromise) {
     1.8 -	    MathJax.typesetPromise(); // MathJax v3
     1.9 -	}
    1.10 +	try {
    1.11 +	    if (MathJax && MathJax.typesetPromise) {
    1.12 +		MathJax.typesetPromise(); // MathJax v3
    1.13 +	    }
    1.14 +	} catch (err) {}
    1.15  	console.log("Update "+cnt+"rows");
    1.16  	if (cnt>0 && ntr.scrollIntoView) {
    1.17  	    let option = {behavior: "smooth"};