布衣王子

          Email:roose2008@gmail.com QQ:79212131

          XMLHTTPrequest 錯(cuò)誤 等待中

          <%@ 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> //錯(cuò)誤提示是這里有錯(cuò),請高手看看
             pass:<input type='password' name='password' onblur="" /><br>
             <input type='submit' name=tijiao  value='提交' id='submit'/>
            </form>
           </div>
           
          </body>
          </html>

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

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

          評論

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

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

          # re: XMLHTTPrequest 錯(cuò)誤 等待中 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 錯(cuò)誤 等待中 [未登錄] 2008-12-15 22:31 草包書生

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


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


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

          導(dǎo)航

          常用鏈接

          相冊

          java的相關(guān)連接

          最新評論

          主站蜘蛛池模板: 景洪市| 临清市| 花垣县| 扶风县| 宁陵县| 永仁县| 密山市| 济南市| 乌什县| 临江市| 阜南县| 钟祥市| 巫山县| 新化县| 高陵县| 达州市| 万载县| 宣化县| 满城县| 澎湖县| 隆昌县| 湖口县| 张北县| 佛山市| 晋城| 白水县| 射阳县| 韩城市| 辽阳县| 大理市| 石景山区| 柳江县| 宁强县| 卓资县| 利津县| 潍坊市| 商河县| 临朐县| 昌邑市| 灌南县| 响水县|