一个简单的json的例子----mui
2015-07-25 15:30
477 查看
mui.ajax(path,{
//传入的参数
data: {
token:token,
gnbh:gnbh
},
dataType:'json',//服务器返回json格式数据
type:'post',//HTTP请求类型
timeout:30000,//超时时间设置为30秒;
success:function(data){
//code是根据后台返回来的数据决定的
if(data.code=='success'){
}
}else{
mui.toast(data.message);
}
},
error:function(xhr,type,errorThrown){
//异常处理;
mui.toast('服务器异常登录失败!');
}
});
//传入的参数
data: {
token:token,
gnbh:gnbh
},
dataType:'json',//服务器返回json格式数据
type:'post',//HTTP请求类型
timeout:30000,//超时时间设置为30秒;
success:function(data){
//code是根据后台返回来的数据决定的
if(data.code=='success'){
}
}else{
mui.toast(data.message);
}
},
error:function(xhr,type,errorThrown){
//异常处理;
mui.toast('服务器异常登录失败!');
}
});
相关文章推荐
- stringbuffer与stringbuilder的区别?
- N-Queens II
- Leetcode: Implement Queue using Stacks
- iOS human Interface Guidelines(原创翻译)第二章
- ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn'
- Majority Element浅谈 (A linear time iceberg query algorithm)
- HBuilder动态的向<ul></ul>中插入<li></li>
- HDU 5301 Buildings(2015多校联合)
- QueryPerformanceFrequency()
- MYSQL的索引类型:PRIMARY, INDEX,UNIQUE,FULLTEXT,SPAIAL
- uva 11045 My T-shirt suits me (二分图匹配 最大流)
- UITextView限制输入字数
- HDU 5301 Buildings
- 如何更好地限制一个UITextField的输入长度
- Android onActivityResult 设置requestCode 返回的code不对
- EasyUI combobox动态增加选择项
- duilib学习之一 增加GroupBox
- UIView的layoutSubviews和drawRect
- Codeforces Round #313 (Div. 2)D. Equivalent Strings(字符串)
- Hibernate的5个核心接口:Session、SessionFactory、Transaction、Query和Configuration