上一段代码有些错误,以下是正确代码:<script>
var sa=window.prompt('请问你要盗窃谁家的网页原文件?','http://');
window.location='view-source:'+sa
</script>
var sa=window.prompt('请问你要盗窃谁家的网页原文件?','http://');
window.location='view-source:'+sa
</script>
function baoGetHTML(url, divTarget)
{
var oHttp = new ActiveXObject("Microsoft.XMLHTTP");
oHttp.open("GET", url, false);
oHttp.send();
//bytes2BSTR(oHttp.responseBody)这就是网页的代码.
SourceCode = bytes2BSTR(oHttp.responseBody);
bao.value = SourceCode;
}
</script><script language="vbscript">
Function bytes2BSTR(vIn)
Dim strReturn,i,ThisCharCode,innerCode,Hight8,Low8,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
</script>
<input type=button onclick="baoGetHTML(document.all.url.value)" value="Get">
<input type=text value="http://www.baidu.com" name="url">
<textarea id=bao style="width:400;height:300"></textarea>
原来Google就是找了几百万人直接查看源代码做的查询数据库啊