今日总结:XML传输
XMLHttpRequest 对象能够:
- 在不重新加载页面的情况下更新网页
- 在页面已加载后从服务器请求数据
- 在页面已加载后从服务器接收数据
- 在后台向服务器发送数据
创建 XMLHttpRequest 对象的语法:
xmlhttp = new XMLHttpRequest();
先建立'数据通道' (note.xml为相关数据)
xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","note.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
关联数据
document.getElementById("to").innerHTML=
xmlDoc.getElementsByTagName("to")[0].childNodes[0].nodeValue;

浙公网安备 33010602011771号