1

JqMath と、ここ Stackoverflow での実装方法について読みましたが、正しく動作させることができません。

欲しいもの 数式、定数、数式を表示する

私がやった こと.3.min.js jscurry-0.4.0.js jscurry-0.4.0.min.js

  1. このコードを書きました:

    private WebView webView;
    private WebSettings webSettings;
    
    //In the constructor
    webView = (WebView) findViewById(R.id.webView);
    webSettings = webView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    path = "file:///android_asset/";
    
    // In the method where I want to set the content
    js = "<html><head>"
            + "<link rel='stylesheet' href='"+path+"jqmath-0.4.3.css'>"
            + "<script src='"+path+"jquery-1.4.3.min.js'></script>"
            + "<script src='"+path+"jqmath-etc-0.4.3.min.js'></script>"
            + "</head><body>"
            + "$$x={-b±√{b^2-4ac}}/{2a}$$</body></html>";
    webView.loadData(js,  "text/html",  "UTF-8");
    

問題 logcat によると:

    E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
    4306-4306/com.fredrikandcasper.matteguide I/chromium: [INFO:CONSOLE(1)]                 
    "Not allowed to load local resource: file:///android_asset/jqmath-
    0.4.3.css", source: data:text/html,<html><head><link rel='stylesheet' 
    href='file:///android_asset/jqmath-0.4.3.css'><script 
    src='file:///android_asset/jquery-1.4.3.min.js'></script><script 
    src='file:///android_asset/jqmath-etc-0.4.3.min.js'></script></head>
    <body>$$x={-b%C2%B1%E2%88%9A{b^2-4ac}}/{2a}$$</body></html> (1)

他のファイルでも同じエラー: jquery-1.4.3.min.js & jqmath-etc-0.4.3.min.js

どうすればこれを解決できますか?

前もって感謝します!

4

0 に答える 0