mui调用webservice
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);
恋花望月轻轻唱 听雨随风悄悄追