如何使用POST方法在XDR中发送JSON数据 [英] How to send JSON data in XDR using the POST method

查看:144
本文介绍了如何使用POST方法在XDR中发送JSON数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用POST方法在XDR中发送JSON数据。我能够发送JSON数据,但问题是(DOT)符号被转换为 _ (下划线)。以下是代码:

I want to send JSON data in XDR using the POST method. I'm able to send JSON data, however the problem is . (DOT) symbols are converted into _ (underscores). Here is the code:

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);
        }
    });
}


推荐答案

可能是你的服务器端脚本是错的..
这段代码似乎是正确的....

May be your server side scripting is wrong.. this code seems to be correct....

这篇关于如何使用POST方法在XDR中发送JSON数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆