javascript - After the form is submitted, the background returns directly to the page. How should I handle it?
代言
代言 2017-07-05 10:48:44
0
1
839

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?

代言
代言

reply all(1)
Peter_Zhu

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";
    // 
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template