关于手写 Ajax
  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浏览器关于频繁传送数据初始化的问题
   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;
===========================
利用函数格式化 POST 请求参数
 function addParam(paramObj, paramName, paramValue){
  if(paramObj.length > 0)
   paramObj += "&";
  return paramObj + encodeURIComponent(paramName)
   + "=" + encodeURIComponent(paramValue);
 }
=============================================
javascript 里面的遍历
for (pop in windowxxxx){
    .....
}
 
                    
                 
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号