[CODE]<html> <head>
<title>A simple AJAX example</title>
<script type="text/javascript"><-- <br>
function findAuthor(file){
var xmlObj = null;
if(window.XMLHttpRequest){
xmlObj = new XMLHttpRequest();
}
else if(window.ActiveXObject){
xmlObj = new ActiveXObject("Microsoft.XMLHTTP");
} else {
return; }
xmlObj.onreadystatechange = function(){
if(xmlObj.readyState == 4){
updateObj('author',
xmlObj.responseXML.getElementsByTagName('name')[0].firstChild.data);
}
}
xmlObj.open ('GET', file, true);
xmlObj.send ('');
}
function updateObj(obj, data){
var textNode = document.createTextNode(data);
document.getElementById(obj).appendChild(textNode);
} //--></script>
</head>
<body>A simple AJAX program</h1> This page is powered by <a href="data.xml" target="_blank" >See Author.</a>
</body>
</html>[/CODE]
我晕,就你这样的代码,那位喜欢看,你既然要人帮忙就不能把代码弄好看点.无语.帮忙你整理下,没帮你看,看这样式都不爽,还要找错误..
反正我不喜欢..
[此贴子已经被作者于2007-6-1 21:15:27编辑过]