<script type="text/javascript">
function createobj() {
if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
return new XMLHttpRequest();
}
}
//代理方式獲取http狀態
function getWebPage(url) {
var oBao=createobj();
var my_url="getpage.asp?site="+escape(url);
oBao.open('get',my_url,false);
oBao.onreadystatechange=function(){
if(oBao.readyState==4){
if(oBao.status==200){ document.write("成功");
// var returnStr=oBao.responseText;
// document.write(returnStr);
}else{
document.write("未找到您輸入的地址或服務器505錯誤!");
}
}
}
oBao.send(null);
}
getWebPage('http://wwww.google.cn/44.html');
</script>
<%
Dim objXMLHTTP, xmlHttp,strUrl
strUrl=Request("site")
Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlHttp.Open "GET", strUrl, False
xmlHttp.Send
if xmlHttp.readystate=4 then
response.write xmlHttp.status
end if
Set xmlHttp = Nothing
%>