布衣王子

          Email:roose2008@gmail.com QQ:79212131

          XMLHTTPrequest 錯誤 等待中

          <%@ page language="java" contentType="text/html; charset=gb2312"
              pageEncoding="gb2312"%>
          <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
          <html>
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
          <title>Ajax請求測試</title>
          <style type="text/css">
           body form{
            margin:100px;
           }
           body input{
            width:200px;
            height:14px;
            margin-top:2px;
            border-width:1px;
            border-style: dashed;
           }
           body #submit{
            border-style:none;
            margin-left:100px;
            margin-top:20px;
            height:20px;
            width:40px;
            background: white;
           }
          </style>
          <script type="text/javascript">
            var xmlHttp;
            function validate(){
              try{
                 // Firefox, Opera 8.0+, Safari
                 xmlHttp=new XMLHttpRequest();
                }catch(e){
                // Internet Explorer
                 try{ 
                  alert("here");
                    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
                   }catch(e){
               try{
                       xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
                      }catch(e){
                       alert("您的瀏覽器不支持AJAX!");
                       return false;
                      }
                   }   
                }
            }
            
            xmlHttp.onreadystatechange=statusdeal(){
             window.alert("here");
             if(xmlHttp.readyState !=0){
              window.alert(xmlHttp.readyState);
             } 
            }
            xmlHttp.open("GET","test.jsp",true);
            xmlHttp.send("");
              
          </script>

          </head>
          <body>
           <div>
            <form action="test.jsp" name="form" method="get">
             user:<input type='text' name='username' id='user' onblur="validate()" /><br> //錯誤提示是這里有錯,請高手看看
             pass:<input type='password' name='password' onblur="" /><br>
             <input type='submit' name=tijiao  value='提交' id='submit'/>
            </form>
           </div>
           
          </body>
          </html>

          始終無法發(fā)出請求,不知道是表單錯誤還是代碼錯誤.
          錯誤提示是:找不到對象

          posted on 2008-12-14 23:19 草包書生 閱讀(988) 評論(3)  編輯  收藏

          評論

          # re: XMLHTTPrequest 錯誤 等待中 [未登錄] 2008-12-15 11:07 草包書生

          各位還是幫幫忙吧,兄弟我真的很急呀!  回復(fù)  更多評論   

          # re: XMLHTTPrequest 錯誤 等待中 2008-12-15 13:03 appurple

          function statusdeal(){
          window.alert("here");
          if(xmlHttp.readyState !=0){
          window.alert(xmlHttp.readyState);
          }
          }
          xmlHttp.onreadystatechange=statusdeal;


          首先查文檔...  回復(fù)  更多評論   

          # re: XMLHTTPrequest 錯誤 等待中 [未登錄] 2008-12-15 22:31 草包書生

          問題已經(jīng)解決  回復(fù)  更多評論   


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           

          導(dǎo)航

          常用鏈接

          相冊

          java的相關(guān)連接

          最新評論

          主站蜘蛛池模板: 怀宁县| 东港市| 安岳县| 雅安市| 谷城县| 磐安县| 西乌| 闵行区| 潞西市| 涟水县| 南漳县| 普安县| 曲水县| 蓬溪县| 元朗区| 壤塘县| 宾阳县| 乳山市| 宿州市| 宁城县| 临泉县| 应用必备| 石楼县| 道孚县| 四平市| 承德县| 石屏县| 当阳市| 秀山| 湟源县| 民县| 都匀市| 安泽县| 扶绥县| 宾川县| 石楼县| 周宁县| 石首市| 通城县| 湘阴县| 东莞市|