XMLHttpRequest控件的另一個重要用途就是可以實現與XML文件的交互
<?xml version=
<employees>
<employee>
<name>Simon</name>
<sex>Male</sex>
<age>
<band>
<salary>
</employee>
<employee>
<name>Elaine</name>
<sex>Female</sex>
<age>
<band>
<salary>
</employee>
<employee>
<name>Susan</name>
<sex>Female</sex>
<age>
<band>
<salary>
</employee>
</employees>
對於使用responseXML屬性返回的對象
<html>
<head>
<title>Ajax Example</title>
<script type=
var xmlobj; //定義XMLHttpRequest對象
function CreateXMLHttpRequest()
{
if(window
//如果當前浏覽器支持ActiveXObject
{
xmlobj = new ActiveXObject(
}
else if(window
//如果當前浏覽器支持XMLHttpRequest
XMLHttpRequest對象
{
xmlobj = new XMLHttpRequest();
}
}
right
From:http://tw.wingwit.com/Article/program/PHP/201311/21448.html