用XMLHTTP和ADODB.oStream可以很方便地得到一个Url地址的源代码。而且效率高。
<script>
var o<a href="http://dev.21tx.com/web/xml/" target="_blank">XML</a>Http = new ActiveXObject("Microsoft.XMLHTTP");
oXmlHttp.open("GET","http://dotnet.<a href="http://dev.21tx.com/web/asp/" target="_blank">ASP</a>x.cc/content.aspx", false);
oXmlHttp.send()
var oStream = new ActiveXObject("ADODB.Stream");
if(oStream == null)
alert("您的机器不支持ADODB.Stream.")
else
{
oStream.Type=1;
oStream.Mode=3;
oStream.Open() ;
oStream.Write(oXmlHttp.responseBody);
oStream.Position= 0;
oStream.Type= 2;
oStream.Charset="gb2312";
var result= oStream.ReadText();
oStream.Close();
oStream = null;
alert( result);
}
</script>
查看本文来源