Ext.Ajax.request无法在IE中工作

时间:2014-04-27 18:45:37

标签: javascript ajax internet-explorer extjs

需要这段代码的帮助......

dummyData = [{name: "test"},{foo: "bar"}];

var postData = {};
postData.csrfi = csrfi;
postData.data   = Ext.JSON.encode(dummyData);


Ext.Ajax.request({
    url:        UrlGenerator.getControllerActionUrl('RfqSE', 'sendQuotations', { media: 'json'} ),
    params: postData,
    callback: function(options, success, response) {
        var showErrorMsg    = true;

        if (success) {
            var obj = Ext.decode(response.responseText);

            if (obj && obj.success === true) {
                showErrorMsg = false;
            }
        }

        if (showErrorMsg) {
            Ext.Msg.alert("error", "some error has occured");
        }

        callback.call();
    }
});

...由于某种原因,params没有被发送到服务器端,它不能只在IE 7,8上工作...... Haven没有尝试9+ ..在chrome和mozilla上工作例外....网址很好,params也很好... 编辑:我使用4.2 ExtJS 任何帮助都非常感谢...

1 个答案:

答案 0 :(得分:0)

使用' jsonData'而不是' params'

Ext.Ajax.request({
        url: url,
        jsonData: postData,
        method: 'POST',
        success:{//Do sonething},
        failure:{//Do sonething},
        scope: this,
        timeout: 100000
    });