<表 id= "table1" class="table1" border="1px">
<tr>
<th>信息</th>
<th>msg</th>
<th>认证码</th>
</tr>
</div>
</div>
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
if (xmlhttp.readyState == 4 && xmlhttp.status = = 200) {
var datastr = xmlhttp.responseText;
var dataobj = JSON.parse(datastr)
let dataarr = [];
for (let i in dataobj) {
dataarr .push(dataobj[i]);
}
var row = table.insertRow(table.rows.length);
var c1 = row.insertCell(0);
c1.innerHTML = dataarr[0];
var c2 = row.insertCell(1);
c2.innerHTML = dataarr[1];
var c3 = row.insertCell(2);
c3.innerHTML = dataarr[2];
}
}
xmlhttp.open("POST", "https://api.123321yun .com/api/user/login?username=test123&password=123456", true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp. send();
#}