| 
varxmlHttp; 
 functionajaxfunction(url,onreadystatechangMethod,param){ 
     if(window.XMLHttpRequest){
         xmlHttp=newXMLHttpRequest();
     }elseif(window.ActiveXObject){ 
         xmlHttp=newActiveXObject("Microsoft.XMLHttp");
     }
     
     if(xmlHttp){
         param=encodeURI(param);  
         param=encodeURI(param);
         xmlHttp.open("post",url,false); 
         xmlHttp.onreadystatechange = onreadystatechangMethod; 
         xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
         xmlHttp.send(param); 
     }
 }
 | 
 SpringMVC中的@RequestMapping修饰的方法在正常情况下虽然可以直接在参数列表中声明参数,但如果在Ajax的Post方式提交时是不会取到值的,所以要用最原始的方法获取参数,
 如果参数中有大量数据,最好用new String接收
| 
@RequestMapping(value = "/page/video/videoReply.do")
     publicString videoReply(HttpServletRequest request,
             HttpServletResponse response) {
   String strId = request.getParameter("strId");
   String content = newString(request.getParameter("content"));
     try{
             content = java.net.URLDecoder.decode(content, "UTF-8");
         } catch(UnsupportedEncodingException e) {
             e.printStackTrace();
         }
  returnnull;
 } 
 |