跨站用asp實現數據提交檢測

<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
%>

發佈了120 篇原創文章 · 獲贊 8 · 訪問量 11萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章