We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
WebView?
java调js: 可以用loadUrl指定 javascript: 协议,然后带上js代码,如 webView.loadUrl("javascript:alert('hello!')") 4.4以后还提供了一个execJavascript方法,更方便调用
webView.loadUrl("javascript:alert('hello!')")
js调java: 可以先写好一个互调接口类,用addJavascriptInterface绑定好,然后js代码里调用 注意:api17以后希望被js调用的需要添加@JavascriptInterface注解,因为api17以前存在漏洞,通过互调接口的getClass()方法可以拿到Class对象,之后通过Class.forName()等一系列反射api可以调用任何方法 也可以在java层通过shouldOverrideUrlLoading拦截跳转请求,js代码里通过跳转页面传递给java
Sorry, something went wrong.
jsbridge这个框架,完美解决了Java和js的交互。
使用DSBridge与js做交互 可以同步和异步交互
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: