使用scriptCharset即可解决问题,用contentType就不一定可以了。
$.ajax({
url: testUrl,
dataType: \'jsonp\',
type: \'post\',
scriptCharset: \'utf-8\'
});
上面的解决方案是最完美的,另外也附上网上的解决方式吧,是用contentType来处理的
jQuery(form).ajaxSubmit({
url: \"ajax.aspx?a=memberlogin\",
type: \"post\",
dataType: \"json\",
contentType: \"application/x-www-form-urlencoded; charset=utf-8\",
success: showLoginResponse
});
虽然也可以用,但是不推荐给大家哈。
本文地址:https://www.stayed.cn/item/18697
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我