Html prompt message display is incomplete

send a request to the background during development. After a successful return, the page is refreshed and the pop-up prompt is successful. The
pop-up window often shows only one line and it ends.

at first

initPage();                 //
showInfo("");        //

then try to use Promise Synchronize

new Promise(function(resolve){
    init.initPage();
    window.onload = function(){   // 
        resolve();
    }
}).then(function(){
    showInfo("");
})

but all failed.

the actual code is developed using require.js sub-module

    // 
    function saveDevicesCallback(result){

      if(result.result == 0){
        // 
        new Promise(function(resolve){
          require(["event/device"],function(init){
            init.initPage();
          });
          resolve();
        }).then(function(){
          showInfo("");
        })
      }else{
          showError("");
      }
    }

want to see the page refresh first and then prompt the message box

Mar.30,2021

refresh the page starts all over again. You mean that if it is a local refresh, DOM operations are all performed by Synchronize, so there is no need to display information asynchronously


.

look at the meaning of the subject initPage () may have done something similar to window.reload () , that is, press the function of F5

.

if you redraw the page in this way, all the processes you mentioned above will be interrupted. It is recommended to deal with the method of initPage () , and do not let the page reload

.
Menu