HBUILDER入門

網上完成的代碼例子太少。自己記錄一下

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);
}
});


});
})

發佈了55 篇原創文章 · 獲贊 3 · 訪問量 8萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章