ajax中文乱码
1、注意:encodeURI要编码两次,具体原因不详。
var URL = "weixin/search?term='香干炒肉'"; URL = encodeURI(encodeURI(URL)); $.ajax({ url: URL, context: document.body, success: function(){ $(this).addClass("done"); }});
1、注意:encodeURI要编码两次,具体原因不详。
var URL = "weixin/search?term='香干炒肉'"; URL = encodeURI(encodeURI(URL)); $.ajax({ url: URL, context: document.body, success: function(){ $(this).addClass("done"); }});