xmldoc = new ActiveXObject("Msxml2.XMLHTTP");
xmldoc.open("GET","http://www.asdf/4152314.xml",false);
xmldoc.send();
xml = xmldoc.responseXML

解决方案 »

  1.   

    谢谢楼上的.但好像不行哦.我是这样获取数据的.
    var root = xmlMatchDoc.documentElement.selectSingleNode("//matches");但用你那个好像获取不到哦.
      

  2.   

    var root = xmlMatchDoc.documentElement.selectSingleNode("//matches");
    ==>
    var root = xmlMatchDoc.responseXML.documentElement.selectSingleNode("//matches");<script>
    function repeat() {
    xmlMatchDoc = new ActiveXObject("Msxml2.XMLHTTP");
    xmlMatchDoc.open("GET","http://community.csdn.net/Expert/topic/4749/4749478.xml",false);
    xmlMatchDoc.send();s=xmlMatchDoc.responseXML.documentElement.selectSingleNode("//TopicName");alert(s.text)
    }repeat();
    </script>
      

  3.   


    var xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    xmlHttp.open("GET","http://www.asdf/4152314.xml",false);
    xmlHttp.send();
    var xmldoc = xmlHttp.responseXML
      

  4.   

    不行哦.错误信息.行:59
    字符:1
    错误:没有权限
    代码:0
    URL:XXXXXX
      

  5.   

    ajax跨域访问是不行的,在服务通过PHP或ASP的来取吧
      

  6.   

    客户端的xmlhttpReqest的确是不能加载其它的站点数据的。只能用服务器端来做,方法是一样的<%
    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    xmlHttp.open "GET","http://www.asdf/4152314.xml",false;
    xmlHttp.send();
    xmldoc = xmlHttp.responseXML
    %>
      

  7.   

    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");这个改为xmlhttp = server.createObject("Msxml2.XMLHTTP")
      

  8.   

    浏览器的安全性设置不允许站点页面中的XMLHttpRequest请求其它站点的内容。不过通过构造IFrame应该可以做到。