search

Home  >  Q&A  >  body text

javascript - After the form is submitted, the background returns directly to the page. How should I handle it?

In the project, after ajax sends a request, a page is returned directly from the background instead of returning a status value.
The page returned may be the page entered after successful submission, or it may be an error page, or a page with abnormal status.
Originally, the prompt window in this regard was returned directly from the background, but now that the project is under secondary development,
we need to process the status window in the foreground, so lay.ui is used.
But the background does not return the status value, but directly returns to the page, so that the page is directly loaded into the pop-up box...
Is there any solution to this problem?

代言代言2743 days ago830

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2017-07-05 10:50:44

    First of all, you must know the status of the returned page,
    For example, successful page, abnormal page or error page,
    You can judge the status based on some contents of the page

    success:function(html){
        var status= $(html).find("xxxx")=="xxxx";
        // 
    }

    reply
    0
  • Cancelreply