Uncaught ReferenceError while loading asset file on android 4.4

后端 未结 4 1577
野的像风
野的像风 2020-12-18 11:41

I am using following MathJax app code. http://cs.jsu.edu/wordpress/?p=498#comment-217

In following function i am trying to load file from asset directory.



        
4条回答
  •  醉梦人生
    2020-12-18 11:49

    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);
    }
    

提交回复
热议问题