JavaScript 读xml 运行报错,看了半天没错误啊,邦个忙啊!
readxml.html 页代码
<!DOCTYPE HTML PUBLIc "1//W3C//DTD XHTML 1.0 Strict//EN "
"http://www.w3.org/TR/xhtml1/DTD/xhtmll1-strict.dtd ">
<html xmlns= "http;//www.w3.org/1999/xhtml ">
<head>
<title> xmlHttprequest </title>
<meta name= "GENERATOR " content= "Microsoft Visual Studio .NET 7.1 ">
<meta name= "ProgId " content= "VisualStudio.HTML ">
<meta name= "Originator " content= "Microsoft Visual Studio .NET 7.1 ">
<script language= "javascript ">
var xmlHttp;
var requestType= " ";
function createXMLHttpRequest()
{
if(window.ActiveXObject)
{
xmlHttp=new ActiveXObject( "Microsoft.XMLHTTP ");
}
else(window.XMLHttpRequest)
{
xmlHttp=new XMLHttpRequest();
}
}
function startRequest(requestedList)
{
// alert( "运行到这里! ");
requestType=requestedList;
createXMLHttpRequest();
alert( "运行到这里! ");
xmlHttp.onreadystatechange=handleStateChange;
xmlHttp.open( "GET ", "city.xml ",true);
xmlHttp.send(null);
}
function handleStateChange()
{
//alert( "运行到这里! ");
if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)