x007xyz
x007xyz
  • 发布:2015-08-29 20:47
  • 更新:2015-09-21 18:18
  • 阅读:2737

【报Bug】在mui.plusReady()中ajax无法同步提交

分类:MUI
mui.plusReady(function(){  
            mui.ajax({  
                url:SERVER_URL+'HomeAppServlet',  
                async: false,  
                data:{campusId:APPID},  
                dataType: 'json', //服务器返回json格式数据    
                type: 'get', //HTTP请求类型  
                timeout: 1000, //超时时间设置为10秒;    
                success: function(data) {  
                    console.log(JSON.stringify(data));  
                },  
                error: function(xhr, type, errorThrown) {  
                    //异常处理;  
                    mui.toast(type);  
                }  
            });  
            console.log('test');  
        });

控制台:
test at html/test.html:30
[object Object] at html/test.html:23

2015-08-29 20:47 负责人:无 分享
已邀请:
Kwela

Kwela

其实很简单,mui和jQuery是兼容的,你直接调用jQuery 的ajax就可以,然后设置async: false,

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