print(data.xpath("./text()[last()]")[0].strip())
它只是显示了
[object Object],[object Object],[object Object],[object Object],[object Object]
如何在“帐户”中输入“login”:“admin@bmwcci.org”:
<script>
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
myObj = JSON.parse(this.responseText);
document.getElementById("bmwcci").innerHTML = myObj.accounts;
}
};
xmlhttp.open("GET", "listbmwcci.php", true);
xmlhttp.send();
</script>
答案 0 :(得分:0)
您可以这样访问,result.accounts[0].login
<强>样本强>
var result = {"accounts": [{"uid": 1130000025409057, "iname": "", "sex": null, "ready": "no", "hintq": "", "aliases": [], "enabled": "yes", "maillist": "no", "fname": "", "birth_date": null, "login": "admin@bmwcci.org", "fio": ""}]};
console.log(result.accounts[0].login);
&#13;