Android Web-view Error I/chromium: [INFO:CONSOLE(1)] "Uncaught ReferenceError:

前端 未结 2 1884
闹比i
闹比i 2021-02-14 13:37

I have a web-service In that I have added bar-code reader for android

So with the Help of JavaScript I am calling my bar-code reader from web-view

So for that I

相关标签:
2条回答
  • 2021-02-14 14:21

    Add this script in Web-service at your Parent Menu which has your iframe or iframes

    <script>
    function actfromAnd(msg){
    window.frames['yourExactframe'].document.getElementById("brcd").value = msg;
    }
    </script>
    

    If you are using same in more than one frame then declare your frame name globally

    I tried your Code Working Fine... In my example Frame Hope It works fine for you

    Nice question....

    0 讨论(0)
  • 2021-02-14 14:23
    • You should execute the javascript when the page is loaded

      mWebView.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { webview.loadUrl("javascript:myFunction()"); } });

    • The code will be executed and will find your javascript function. The way you are doing now does not wait.

    0 讨论(0)
提交回复
热议问题