ajax提交到后台是中文乱码

运行程序时遇到用ajax的url中传递数据,后台用request.getParamet()时出现中文乱码

$.ajax({
            type: "POST",   
            url:  g_sBasePath+"restoreaccount/accountRestore.action?accountno=" +accountno,

            success: function(msg){}

 

解决方法,在ajax的data中把需要传递的数据传递过去,后台获得数据后就不会乱码

$.ajax({
	                type: "POST",   
	                url: g_sBasePath+"restoreaccount/accountRestore.action",
	                data :"array=" + accountno +","+noteex,
	                success: function(msg){
posted @ 2016-11-18 15:06  西红柿鸡蛋面  阅读(253)  评论(0编辑  收藏  举报