天天看點

解決jQuery Ajax送出中文參數變成亂碼的方法

解決方法:

在Ajax中添加語句“contentType: "application/x-www-form-urlencoded; charset=utf-8"”

具體操作如下:

$.ajax({ type : "POST", cache : false, url : _url, data : _data, contentType : "application/x-www-form-urlencoded; charset=utf-8", success : function(msg) { callback(msg); } });

繼續閱讀