Android passes data to h5 page. Does h5 page have to have click events?

Android calls the h5 page, and as soon as it jumps to the h5 page, it sends the data to the h5 page, and then the h5 page renders, so how does Android transmit the data? must there be a click event on the h5 page

Mar.19,2021

you don't have to click on the event, but you need a way to receive parameters from Android


method 1
Android can pass parameters to h5 links and splice them in a form similar to ? xx=xx&xx=xx .
js parses parameters.

method 2
Native app can trigger the function of js. All the frontend needs to do is to define the method name and parameters of js and give them to Android personnel.


does not require a click event. When the H5 page is loaded, you can call the Android custom method through javascript (similar to calling the js function). After successful execution, Android will conduct a callback callback to return the data to H5.


this is the page written in webview, and the same click event interacts with Android and ios. Note that jq's ready.document. Attribute

Menu