Confirmation of the popup:
mui.confirm(content.shift(), "", forupar, function(res) { if(res.index == 0){ //Click the confirmed callback function, and the second pop-up box will pop up at this time. }
Here's an optimization:
You can do it using recursion:
var forupar = ["OK", "Cancel"]; var content=[ "Is the description clear and the order address in the item description is clear?", "Is the photo correct?", "Is the item location accurate?("+$("#searchinput").val()+")" ]; function dialog(){ mui.confirm(content.shift(), "", forupar, function(res) { if(res.index == 0){ if(content.length==0){ // perform the actual data submission operation add_report(); } dialog(); return; } }); } dialog();
That is, it keeps recursing itself to meet the needs.
Skill is stronger. It is better than writing the callback logic layer by layer directly. Because if there were 10 popups it would be Sabie.
It can also be done with the help of promises.