我想使用POST方法在XDR中发送JSON数据。我可以发送JSON数据,但是问题是. (点)符号被转换成_ (下划线)。代码如下:
if ($.browser.msie && window.XDomainRequest) {
var xdr = new XDomainRequest();
xdr.open("POST",Path);
xdr.send(JSON.stringify(data) + '&ie=1');
xdr.onerror = function() {
alert('in error');
};
xdr.onload = function() {
alert(xdr.responseText);
}
} else {
jQuery.ajax({
type: "POST",
url: Path,
data: JSON.stringify(data),
dataType: 'json',
contentType: 'application/json',
success: function(msg) {
alert(msg);
}
});
}发布于 2013-09-03 02:49:10
可能是您的服务器端脚本错误..这段代码似乎是正确的...
https://stackoverflow.com/questions/10442961
复制相似问题