javascript - js (mui) How to achieve real-time postback of two interfaces?
滿天的星座
滿天的星座 2017-06-12 09:30:46
0
6
750

Click a button to pop up another interface and pass the value to another interface

After modifying the value in another interface, click the return button to return to the previous interface. How to pass the parameters to the previous interface at this time? ?

Using the mui framework, please solve it, thank you

滿天的星座
滿天的星座

reply all(6)
女神的闺蜜爱上我

Use
window.addEventListener('method name', function(event){
//The passed parameter content can be obtained through event.detail
});
on the page to be accepted to start event listening. Call
mui.fire(pageId,'method name',{}) on the page that needs to trigger the event;
The first parameter is the object that needs to accept the page, which can be obtained through plus.webview.getWebviewById('page id'),
The second is the name of the method that listens to the event,
The third is the parameters you want to pass, please see

阿神

Dear, do you think you want to draw me? However, this requirement is easy to handle. The key is to constantly monitor the operations on one page and then pass the value to another page for rendering!

大家讲道理

For mui, there is a mui.fire method, you can check it out; the previous interface returned is the opener() of another interface

巴扎黑

This is a problem of passing values ​​in mui. There are many methods. It is recommended to use custom events to refresh the previous page. Detailed explanation of HTML5+ APP page parameter passing

世界只因有你

Or use the simplest localstorage to pass the value

迷茫

The answer using mui.fire is the correct answer

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template