不可以阿,xmlhttp执行包含的页面这么取不出数据来的

解决方案 »

  1.   

    数据也可以取到的。你得解析一下得到VALUE值
      

  2.   

    下面的例子从1.asp中获取<img id="image"/>代码,然后设置src<style>
    div{width:300px;height:200px;background-color:red;}
    </style>
    <script>
    function get(url,obj)
    {
      var xmlhttp=new ActiveXObject("Microsoft.xmlhttp");
      xmlhttp.open("get",url,false);
      xmlhttp.send();  if(xmlhttp.status==200)
       {
         obj.innerHTML=xmlhttp.responseXML.xml;
         alert(xmlhttp.responseXML.xml);
       }
    }
    function set()
    {
       document.getElementById('image').src='1.jpg';
    }
    </script>
    <body>
    <div id="a"></div><br>
    <input type=button value="xmlhttp获取代码" onclick="get('1.asp',a)">
    <input type=button value="设置图片" onclick="set()">
    <br>
    </body>1.asp:
    <%
      response.contenttype="text/xml"
      response.write "<img id='image'/>"
    %>
      

  3.   

    king2003(鱼):
    那个value是这么解析的,可以说详细点嘛?
      

  4.   

    用eval可不可以执行阿?
    怎么执行??