jquery返回的数据是乱码处理

乱码现象处理示例:

function jrnew(){

var path=currentProjectPath+"/supervision-statistics/log/getNewInfo.shtml";

$.ajax({ 

        type:"post",

        url:path,

        dataType:"text",

        async :false,

        success:function(returndata){ 

    document.getElementById('newinfo').innerHTML = returndata;

        }

  })

}

@RequestMapping("/getNewInfo")

@ResponseBody

public void getNewInfo(HttpServletResponse response) throws Exception{//注此方法不能设置成返回string字符串,否则出现乱码的现象

HtmlUtil.writerJson(response, sysLogService.getNewInfo());

}

猜你喜欢

转载自yingyingsheji.iteye.com/blog/2370614
今日推荐