jquer使用ajax

jquery使用ajax时返回xml时:
前台的请求方法:
vfunction dosubmit(packageId){
	$.ajax({
		   type: "POST",
		   url: "/yy/tt.jhtml",
		   data: "Action=firm&id=2&name=tttt",
		   success: function(msg){
		     $("#layer_msg").text($(msg).find("msg").text());
		   }
	}); 
}


后台返回如下:
		response.setContentType("text/xml; charset=UTF-8");
		PrintWriter printWriter=response.getWriter();
		printWriter.println("<response><msg>dfdfdfdfd</msg></response>");
		printWriter.close();

你可能感兴趣的:(java,jquery,Ajax,xml)