url传中文,乱码,即便charset为 UTF-8,
$.ajax({ type: "POST", cache: false, url: "/ProductTypeAndCat/AddType?typeName=" + typeName, contentType: "application/x-www-form-urlencoded; charset=UTF-8", datatype: "JSON", });
![](https://img.laitimes.com/img/_0nNw4CM6IyYiwiM6ICdiwiIn5GcuATNwgjMykzMzgTN5ATOy8CX3ATNxAjMvwVM2AzMyEzLcd2bsJ2Lc12bj5ycn9Gbi52YuAzcldWYtl2Lc9CX6MHc0RHaiojIsJye.png)
data传中文,正确。
url: "/ProductTypeAndCat/AddType", data: {typeName:typeName}, success: function (data) { if (data.F == 0) { alert("添加陈功"); location.href = "/Admin/ProductType"; } else { alert(data.M); }, error: function (xhr, status, error) { alert(error); }
本文转自最课程陆敏技博客园博客,原文链接:http://www.cnblogs.com/luminji/p/4685127.html,如需转载请自行联系原作者