posts - 6, comments - 6, trackbacks - 0, articles - 0

          2007年4月23日

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          <html xmlns="http://www.w3.org/1999/xhtml">
          <head>
          <script type="text/javascript">
          /* Create a new XMLHttpRequest object to talk to the Web server */
          function getbw()
          {
              var xmlhttp;
           try {
            xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
           } catch (e) {
            try {
             xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            } catch (oc) {
             xmlhttp=null;
            }
           }
           if(!xmlhttp && typeof XMLHttpRequest != "undefined")
            xmlhttp = new XMLHttpRequest();
          return xmlhttp;
          }
           
              function IDRequest(n) {
           xmlhttp=getbw();
              //定義收到服務器的響應后需要執行的JavaScript函數
              url=n+document.getElementById('163id').value;//定義網址參數
              alert(url);
           xmlhttp.open("GET",url, true);       
           xmlhttp.send(null);        
              //xmlhttp_request=getXMLRequester();//調用創建XMLHttpRequest的函數       
              xmlhttp.onreadystatechange = doContents;//調用doContents函數       

              }   
              function doContents() {       
              if (xmlhttp.readyState == 4) {// 收到完整的服務器響應           
                  if (xmlhttp.status == 200) {//HTTP服務器響應的值OK
            
                 document.getElementById('message').innerHTML = xmlhttp.responseText;//將服務器返回的字符串寫到頁面中ID為message的區域           
                  } else {               
                  alert(xmlhttp.status);
                  }       
                  }   
                  }
                  </script>
          </head>
          <body>
          <input type="text" id="163id" />
          <input type="button" value="校驗" onclick="IDRequest('check.php?userid=')" />
          <div id="message"></div>
          </body>
          </html>

          posted @ 2007-04-23 19:10 吳濤濤 閱讀(395) | 評論 (0)編輯 收藏

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
          <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
          <title>javascript生成上傳圖像預覽功能</title>
          </head>
          <body>
          <INPUT id=photo1 style="WIDTH: 350px"   onpropertychange="if(event.propertyName=='value') preview1.src=photo1.value.replace(/\\/g,'/')"
                      type=file name=photo1>
          <br />
          <IMG id=preview1 height=66 src="圖片博客-上傳圖片_files/sampe3.jpg"
          width=66 name=preview1>
          </body>
          </html>

          posted @ 2007-04-23 19:09 吳濤濤 閱讀(445) | 評論 (0)編輯 收藏

          主站蜘蛛池模板: 三门县| 寿阳县| 岐山县| 宜州市| 汉寿县| 灌云县| 永泰县| 赣州市| 抚顺市| 龙胜| 银川市| 泗洪县| 青岛市| 土默特右旗| 如皋市| 花莲县| 临颍县| 苍南县| 盐边县| 韶山市| 镇原县| 淮南市| 陆良县| 繁峙县| 弋阳县| 青铜峡市| 阳泉市| 南汇区| 邵阳县| 陆丰市| 航空| 富顺县| 永寿县| 日土县| 南投市| 丹凤县| 江油市| 济宁市| 肥东县| 塘沽区| 子洲县|