Giter Site home page Giter Site logo

Comments (7)

xiubojin avatar xiubojin commented on September 1, 2024

什么意思?

from jxbwkwebview.

GreatLiyi avatar GreatLiyi commented on September 1, 2024

什么意思?
原生界面push到webview的时候,怎么把值传给service层,service层是和js交互的

from jxbwkwebview.

xiubojin avatar xiubojin commented on September 1, 2024

native主动和web交互不能依靠service,得通过webview执行那个js脚本api给web传值。所以你至少得等js资源加载完成之后才能执行js脚本。

from jxbwkwebview.

xiubojin avatar xiubojin commented on September 1, 2024

或者你在service层把方法准备好,等web资源都加载完成后让web主动调用你的service方法去拿数据。

from jxbwkwebview.

GreatLiyi avatar GreatLiyi commented on September 1, 2024

或者你在service层把方法准备好,等web资源都加载完成后让web主动调用你的service方法去拿数据。

问题是service层怎么获取native的数据,是不是native把值传到webview,然后获取topviewcontroller的数据吗,活着通过单例传值

from jxbwkwebview.

xiubojin avatar xiubojin commented on September 1, 2024

两个办法:
1、web加载完成后,你获取到当前的webview然后执行js脚本,把值传给web。
2、在service里,想办法获取到数据(单例、数据库、归档什么都可以),再传给web。

from jxbwkwebview.

GreatLiyi avatar GreatLiyi commented on September 1, 2024

两个办法:
1、web加载完成后,你获取到当前的webview然后执行js脚本,把值传给web。
2、在service里,想办法获取到数据(单例、数据库、归档什么都可以),再传给web。

好的,谢谢哈,可以close了

from jxbwkwebview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.