使用Ajax从服务器端返回json数据时如果有回车符(\r\n),客户端解析会出错, 所以在这之前先将回车符替换掉才行 json.replace("\r\n", "<BR>");//单个替换 json.replace(/\\r\n/g, "<BR>"));//全部替换