Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用POST方法在XDR中发送JSON数据_Javascript_Json_Xdr - Fatal编程技术网

Javascript 如何使用POST方法在XDR中发送JSON数据

Javascript 如何使用POST方法在XDR中发送JSON数据,javascript,json,xdr,Javascript,Json,Xdr,我想使用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 =

我想使用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);
        }
    });
}

可能是服务器端脚本编写错误。。
此代码似乎正确….

服务器端脚本中存在问题。在解决了这个问题后,它现在工作得非常好。继续,把它作为一个答案,并标记它是正确的,这样这个问题就成为了一个“正确”的答案。