dataType:"json"

dataType:"json"会造成前台无法获取json字符串

String outstr="{\"clientid\":\""+clientid+"\"}";
System.out.println("outstr:"+outstr);
out.print(outstr);

$.ajax({
            type : "POST",
            url : "getclientid.jsp",
            data : {"send_date":send_date},
            cache:false,
            success : function(data){
          var objJson = eval("(" + data + ")");   //json字符串转换为Object
$("#clienid").attr("value",objJson.clientid);
            },
            error : function(){
          $("#clienid").attr("value","");
            }
          });

你可能感兴趣的:(json)