Ajax调用Servlet

 

function doRequestUsingPost(aff)
{
         var Xml_Http_Request=CreateReqeust();
         var url= "XZG_Servlet/WriteXml?timeStamp=" + new Date().getTime();
         var queryString=createQueryString(aff);
         Xml_Http_Request.open( "POST",url, true);
         Xml_Http_Request.onreadystatechange= function()
         {
                 if(Xml_Http_Request.readyState==4)
                 {
                             if(Xml_Http_Request.status==200)
                            {
                                    parseResults();
                            }
                 }
         }
         Xml_Http_Request.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded");
         Xml_Http_Request.send(queryString);
}

function createQueryString(LayerInfo)
{    
         var queryString = "LayerInfo=" + LayerInfo;
         return queryString;
}

你可能感兴趣的:(Ajax,servlet,职场,休闲)