怎么把rst的值 显示在 this.label.string上呢?
onLoad: function () {
this.label.string = "";
var xhr = new XMLHttpRequest;
xhr.open('post', 'http://localhost/aa.php',true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send();
xhr.onreadystatechange = function() {
if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status ==304)) { //响应完成并且响应码为200或304
var rst = JSON.parse(xhr.responseText);
console.log(rst);
//console.log(rst.name);
}
}
},