search

Home  >  Q&A  >  body text

javascript - js (mui) How to achieve real-time postback of two interfaces?

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

滿天的星座滿天的星座2771 days ago769

reply all(6)I'll reply

  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-06-12 09:32:46

    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

    reply
    0
  • 阿神

    阿神2017-06-12 09:32:46

    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!

    reply
    0
  • 大家讲道理

    大家讲道理2017-06-12 09:32:46

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

    reply
    0
  • 巴扎黑

    巴扎黑2017-06-12 09:32:46

    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

    reply
    0
  • 世界只因有你

    世界只因有你2017-06-12 09:32:46

    Or use the simplest localstorage to pass the value

    reply
    0
  • 迷茫

    迷茫2017-06-12 09:32:46

    The answer using mui.fire is the correct answer

    reply
    0
  • Cancelreply