1Successfunction(data) {2 if(data.xx = = "XX")3 { 4 //code ...5Window.location.href = "Success.aspx";6 }7 if(data.xx = = "ss")8 {9 //Code:Tenwindow.location.href= "Failed.aspx": One}
You can use JSON to judge the returned data, if the JSON data is returned successfully, what kind of JSON data will be returned, and then the if code can customize the link.
PHP notation
1 $data= ' {' Data ': ' 1 '} '; 2 Echo $data;
Note:
"Top.location.href" is the outermost page jump
"Window.location.href", "location.href" is this page jump
"Parent.location.href" is a page jump on the previous level.
The location is a property of the Window object, and all the objects under the page are in the window scope chain (this is the top-level scope), so you can omit window when you use it. The top is a pointer to the top-level window object, and the parent is a pointer to the Window object.
How to manage a redirect request after JQuery's Ajax call