技术文章分类(180)

技术随笔(11)

ajax中文乱码

1、注意:encodeURI要编码两次,具体原因不详。

var URL = "weixin/search?term='香干炒肉'";
URL = encodeURI(encodeURI(URL));

$.ajax({ url: URL, context: document.body, success: function(){
        $(this).addClass("done");
      }});

 

posted @ 2014-04-08 10:36  坤哥MartinLi  阅读(84)  评论(0编辑  收藏  举报