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. 

'Android' 카테고리의 다른 글

Activity & Fragment transition  (0) 2015.08.06
animation basic example  (0) 2015.08.05
Passing a string to C-code in Android NDK  (0) 2015.04.29
adb connect (remotely)  (0) 2015.03.28
AIDL  (0) 2013.10.25