HBUILDER入门

来源:互联网 发布:常用排序算法java 编辑:程序博客网 时间:2024/05/14 13:12

网上完成的代码例子太少。自己记录一下

mui.init()


mui.plusReady(function() {

document.getElementById("login").addEventListener('tap', function() {
var username = document.getElementById("username").value;
console.log(username);
var password = document.getElementById("password").value;
console.log(password);
mui.ajax('http://192.168.0.109:8080/Ruif.Web/admin/mobile/doLogin', {
data: {
username:"admin",
password: "password"
},
dataType: "json",
type: "get",
timeout: 600,
success: function(data) {
alert("11" + data);
console.log(JSON.stringify(data));
 
},
error: function(xhr, type, errorThrown) {
console.log(type);
alert("22" + xhr);
}
});


});
})

0 0
原创粉丝点击