Android
Uncaught ReferenceError while loading asset file on android 4.4
tomato13
2016. 6. 17. 14:10
http://stackoverflow.com/questions/20582282/uncaught-referenceerror-while-loading-asset-file-on-android-4-4
You have to replace all the lines loadUrl(...)
with evaluateJavascript(...)
. But this is only for KitKat (API 19 or above), so you need to do an SDK version check first:
if (android.os.Build.VERSION.SDK_INT < 19) {
mWebView.loadUrl("javascript:MathJax.Hub.Queue(['Typeset',MathJax.Hub]);");
} else {
mWebView.evaluateJavascript("javascript:MathJax.Hub.Queue(['Typeset',MathJax.Hub]);",null);
}
When I updated a math tester code in long time, the MathJax didn't work. I spent about several hours on this issue. Finally, I found a helping page. Now it works fine.