您的位置:首页 > 产品设计 > UI/UE

mui调用webservice

2016-05-25 22:13 381 查看
document.getElementById("confirm").addEventListener('tap', function() {
var respnoseEl = document.getElementById("response");
respnoseEl.innerHTML = '正在请求中...';
mui.ajax('http://192.168.0.79:8080/SMSService.asmx/Request', {
data: {
'_arg0: username',
'_agr1: password'
},
dataType: 'json', //服务器返回json格式数据
type: 'post', //HTTP请求类型
timeout: 10000, //超时时间设置为10秒;
success: function(data) {
//服务器返回响应,根据响应结果,分析是否登录成功;
respnoseEl.innerHTML = 'w...';
},
error: function(xhr, type, errorThrown) {
//异常处理;
debugger
respnoseEl.innerHTML = xhr.statusText+'**'+errorThrown;
console.log(type);
}
});

})(mui);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: