<script>
var xmlHttp = null;
if (window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
} if(xmlHttp)
{
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
var sXml = xmlHttp.responseXml;
var xslDeclare = sXml.createProcessingInstruction("xml-stylesheet","type='text/xsl' href='我的.xsl'");
sXml.replaceChild(xslDeclare,sXml.childNodes[1]); //替换原来的xml-stylesheet
alert(sXml.xml);//output
}
else
{
alert("error happen,error status:"+xmlHttp.status);
}
}
} xmlHttp.open("GET","http://rss.business.sohu.com/rss/gongsixinwen.xml",true);
xmlHttp.send(null); }</script>
var xmlHttp = null;
if (window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
} if(xmlHttp)
{
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
var sXml = xmlHttp.responseXml;
var xslDeclare = sXml.createProcessingInstruction("xml-stylesheet","type='text/xsl' href='我的.xsl'");
sXml.replaceChild(xslDeclare,sXml.childNodes[1]); //替换原来的xml-stylesheet
alert(sXml.xml);//output
}
else
{
alert("error happen,error status:"+xmlHttp.status);
}
}
} xmlHttp.open("GET","http://rss.business.sohu.com/rss/gongsixinwen.xml",true);
xmlHttp.send(null); }</script>
确实有难题待解决
先把这解决了,,你就是高人
http://topic.csdn.net/u/20090223/16/aaaed7b2-3808-4ad7-8224-5520575ae56a.html