AJAX Post后中文接收显示的乱码问题

AJAX Post后中文接收显示的乱码问题解决方法:

使用escape() 函数
解决方法很简单:使用javascript中的 escape(string) 函数
http_request.open("POST",url,true);
http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http_request.send("action="+strName+"&val="+escape(val)); //val的值为中文不会产生乱码

posted @ 2007-08-29 04:19  叶川  阅读(505)  评论(0编辑  收藏  举报