<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-7  評論-24  文章-102  trackbacks-0

      function createHttpRequest(){
       var httprequest=false;
       if (window.XMLHttpRequest)
       { // if Mozilla, Safari etc
         httprequest=new XMLHttpRequest();
         if (httprequest.overrideMimeType)
           httprequest.overrideMimeType('text/xml');
        }
        else if (window.ActiveXObject)
        { // if IE
          try {
            httprequest=new ActiveXObject("Msxml2.XMLHTTP");
          }
          catch (e){
            try{
               httprequest=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e){}
          }
        }
        return httprequest;
     }
     
     
    function createXml(str){
    if(document.all){
     var xmlDom=new ActiveXObject("Microsoft.XMLDOM")
     xmlDom.loadXML(str)
     return xmlDom
    }
    else
     return new DOMParser().parseFromString(str, "text/xml")
    }

     

     

      function showSchedule(sid,f){
       var url = "../schedule.do?operate=toFindById";
       var postStr = "uid=" + encodeURI(sid);
           
        //IE瀏覽器關于頻繁傳送數(shù)據初始化的問題
       httpRequest.open("POST", url, true);
       httpRequest.onreadystatechange = function(){
        if(httpRequest.readyState == 4)
         if(httpRequest.status == 200){
          var xml = createXml(httpRequest.responseText);
          var item = xml.getElementsByTagName("Schedule")[0]; 
          
          var scheduleId = item.getElementsByTagName("scheduleId")[0].firstChild.nodeValue;
          var title = item.getElementsByTagName("title")[0].firstChild.nodeValue;
          var schContent = item.getElementsByTagName("schContent")[0].firstChild.nodeValue;
          var address = item.getElementsByTagName("address")[0].firstChild.nodeValue;
          var ifPrivate = item.getElementsByTagName("ifPrivate")[0].firstChild.nodeValue;
          var createTime = item.getElementsByTagName("createTime")[0].firstChild.nodeValue;
          var beginTime = item.getElementsByTagName("beginTime")[0].firstChild.nodeValue;
          var endTime = item.getElementsByTagName("endTime")[0].firstChild.nodeValue;
          var meetingId = item.getElementsByTagName("meetingId")[0].firstChild.nodeValue;      

          f.scheduleId.value = scheduleId;
          f.title.value = title;
          f.address.value = address;
          f.meetingId.value = meetingId;
          f.schContent.value = schContent;
          if(ifPrivate == 0)
           f.ifPrivate.checked = true;
          else
           f.ifPrivate.checked = false;
          
          f.beginTime.value = beginTime;
          f.endTime.value = endTime;  
          f.option.value = "doModify";   
         }
       }
       httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
       httpRequest.send(postStr);
      }



    ====================================

    dom4j-1.6.1.jar

    import org.dom4j.Document;
    import org.dom4j.DocumentHelper;
    import org.dom4j.Element;

        Document doc = DocumentHelper.createDocument();
        Element node = doc.addElement("Depart");
        
        Element departId = node.addElement("departId");
        departId.setText(item.getDepartId().toString());
        Element branchId = node.addElement("branchId");
        branchId.setText(item.getBranchId().toString());
        Element departName = node.addElement("departName");
        departName.setText(item.getDepartName());
        Element principalUserId = node.addElement("principalUserId");
        principalUserId.setText(item.getPrincipalUserId().toString());
        Element connectTelNo = node.addElement("connectTelNo");
        connectTelNo.setText(item.getConnectTelNo());
        Element connectMobileTelNo = node.addElement("connectMobileTelNo");
        connectMobileTelNo.setText(item.getConnectMobileTelNo());
        Element faxes = node.addElement("faxes");
        faxes.setText(item.getFaxes());
        
        PrintWriter out = response.getWriter();
        out.println(doc.asXML());
        out.flush();
        out.close();


    ================================

    request.setContentType("text/xml");

    httpRequest.resoponseXML;

    ===========================
    利用函數(shù)格式化 POST 請求參數(shù)

     function addParam(paramObj, paramName, paramValue){
      if(paramObj.length > 0)
       paramObj += "&";
      return paramObj + encodeURIComponent(paramName)
       + "=" + encodeURIComponent(paramValue);
     }


    =============================================
    javascript 里面的遍歷

    for (pop in windowxxxx){
        .....
    }

    posted on 2009-03-22 09:50 黃小二 閱讀(432) 評論(0)  編輯  收藏 所屬分類: Ajax
    主站蜘蛛池模板: 午夜寂寞在线一级观看免费| 亚洲免费无码在线| 国产精品亚洲专区无码唯爱网| 小小影视日本动漫观看免费| 国产线视频精品免费观看视频| 亚洲黄色免费网址| 国产免费一区二区三区VR| 国产一级片免费看| 亚洲av无码av在线播放| 国产亚洲精品a在线无码| 国产精品美女午夜爽爽爽免费| 青青草国产免费国产是公开| 亚洲色偷偷av男人的天堂| 免费国产成人午夜电影| 在线看无码的免费网站| 免费人妻精品一区二区三区| 91久久亚洲国产成人精品性色| 免费一级毛片不卡在线播放| 亚洲毛片免费视频| 日日躁狠狠躁狠狠爱免费视频 | 亚洲色欲久久久久综合网| 毛片免费vip会员在线看| 久久国产乱子免费精品| 成人福利免费视频| 国产精品免费看久久久无码| 国外成人免费高清激情视频| 亚洲AⅤ视频一区二区三区| 亚洲国产精品无码久久一区二区| 亚洲熟妇无码八V在线播放| 免费v片在线观看| 91久久青青草原线免费| 亚欧在线精品免费观看一区| 国产A在亚洲线播放| 免费国产人做人视频在线观看| 亚洲最大免费视频网| 爱丫爱丫影院在线观看免费| 免费观看亚洲人成网站| 亚洲最大的成人网站| 337p日本欧洲亚洲大胆艺术| 亚洲老妈激情一区二区三区| 亚洲国产精品自在拍在线播放|