Call jQuery function in Android's WebView from Java?

前端 未结 4 857
心在旅途
心在旅途 2021-01-15 01:19

I am trying to call javascript function which is defined in html like

WebView.loadUrl(\"javascript:hoge()\");

I can call non-jQuery functio

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-15 01:56

    well, you can always call a javascript function using loadUrl methode of your webview;

    myWebView.loadUrl("Javascript: alert('test');");
    

提交回复
热议问题