<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns<head> <title>this is test</title>
<script type var xmlHttp;
function createXMLHttpRequest() { if (window.ActiveXObject) { xmlHttp =new ActiveXObject("Microsoft.XMLHTTP"); } elseif (window.XMLHttpRequest) { xmlHttp =new XMLHttpRequest(); } }
function ResultSet() { var results = xmlHttp.responseXML; var title =null; var item =null; var link=null; var author=null; var pubDate=null; var description=null; //得到channel var ccc=results.getElementsByTagName("channel"); var headtitle=ccc[0].getElementsByTagName("title")[0].firstChild.nodeValue; var headlink=ccc[0].getElementsByTagName("link")[0].firstChild.nodeValue; var cell = document.createElement("div"); cell.innerHTML="<h1><a href="+headlink+" target=_blank>"+headtitle+"</a></h1><br>"; document.getElementById("result").appendChild(cell); //得到items var items = results.getElementsByTagName("item"); for(var i =0; i < items.length; i++) { item = items[i]; link=item.getElementsByTagName("link")[0].firstChild.nodeValue; title = item.getElementsByTagName("title")[0].firstChild.nodeValue; author=item.getElementsByTagName("author")[0].firstChild.nodeValue; pubDate= item.getElementsByTagName("pubDate")[0].firstChild.nodeValue; // description=item.getElementsByTagName("description")[0].firstChild.nodeValue; var cell = document.createElement("div"); cell.innerHTML="<a href="+link+" target=_blank>"+title+"</a><font color=red>     作者:</font>"+author+"<br>";