c***@163.com
c***@163.com
  • 发布:2019-06-14 10:07
  • 更新:2019-06-14 10:07
  • 阅读:777

mui ajax 如何 终止请求,在触发返回的时候终止请求

分类:MUI
复制代码var xhr = $.ajax(baseUrl + 'modules/mobile/receipt/redemption/csh_pay_receive_redemption.svc', {  
                            data: query_info,  
                            dataType: 'json', //服务器返回json格式数据  
                            type: 'post', //HTTP请求类型  
                            async: false,  
                            timeout: 2000, //超时时间设置  
                            beforeSend: function() {  
                                plus.nativeUI.showWaiting('loading', {  
                                    loading: {  
                                        display: 'block',  
                                        height: '32px'  
                                    }  
                                })  
                                mask.show(); //显示遮罩层  

                            },  
                            complete: function() {  
                                plus.nativeUI.closeWaiting();  
                                mask.close();  
                            },  
                            success: function(data) {  
                                // console.log('data:' + JSON.stringify(data));  
                                var obj = JSON.stringify(data.result.redemption_info.record);  
                                if (obj) {  
                                    var query_list = data.result.redemption_info.record;  
                                    generate(query_list);  
                                    $('#result')[0].style.display = 'block';  
                                    $('.info')[0].style.display = 'none';  
                                } else {  
                                    $('#result')[0].style.display = 'none';  
                                    $('.info')[0].style.display = 'block';  
                                }  
                            },  
                            error: function(xhr, type, errorThrown) {  
                                //异常处理;  
                                console.error(type);  
                                $.toast('连接服务器失败 请重新登录');  
                            }  
                        });
2019-06-14 10:07 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复

  • 标题 / 粗斜体
  • 代码片段
  • 超链接 / 图片 / 视频
  • 列表 / 引用

文章内容较多时,可以用标题分段 :

## 大标题 
### 小标题

斜体 / 粗体 :

**粗体** 
*斜体*
***粗斜体***

代码片段 :

``` javascript
代码片段
```

超链接 :

[链接文字](链接地址) 例: [百度](http://www.baidu.com)

图片 :

![图片说明](图片地址) 例: ![百度logo](http://www.baidu.com/img/bdlogo.gif)

视频 :

!![视频说明](视频地址) 例: !![优酷视频](http://youku.com)

有序列表 :

1. 123
2. 123
3. 123

无序列表 :

- 123
- 123
- 123

引用 : ( 双回车后结束引用 )

> 引用内容
引用内容
引用内容