window.onload=function(){
var request=new XMLHttpRequest();
request.open("GET","http://study.163.com /webDev/couresByCategory.htm",true);
request.send();
request.onreadystatechange=function(){
if (request.readyState===4&&request.status===200) {
var data=JSON.parse(request.responseText);
document.getElementById("name").innerHTML=data.name;
}else{
alert("发生错误"+request.status);
}
}
}
添加回答
举报
0/150
提交
取消