最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jQuery AJAX and IE8 outputs "Invalid argument" - Stack Overflow

programmeradmin0浏览0评论

guys! It is very strange thing. This code normally works in all browsers I know, except IE8 (may be IE7 too).

function xajax_xfrmproc(sender, eventname, data, formname, data2) {

var dt = {};
dt.__xr = 1;            // AJAX request flag
dt.__sender = sender;
dt.__eventname = eventname;
dt.__data = data;
dt.__formname = formname;
dt.__data2 = data2;

$.ajax({
    type: 'POST',
    url: '',
    data: dt,
    error: function(req, text, error) {
        alert('AJAX Error: ' + text + ' | ' + error + ':' + "\n" + req.responseText);
    },
    success: function (json) {
        jxr_decode(json);
    },
    dataType: "json"
});
}

It calls error method and writes: "AJAX Error: error | Error: Invalid argument".

You can test is online here: (enter any values and press "Войти в статистику" button).

I check in over all internet but not found anything useful. I've tried to set AddDefaultCharset utf-8, nothing happens.

guys! It is very strange thing. This code normally works in all browsers I know, except IE8 (may be IE7 too).

function xajax_xfrmproc(sender, eventname, data, formname, data2) {

var dt = {};
dt.__xr = 1;            // AJAX request flag
dt.__sender = sender;
dt.__eventname = eventname;
dt.__data = data;
dt.__formname = formname;
dt.__data2 = data2;

$.ajax({
    type: 'POST',
    url: '',
    data: dt,
    error: function(req, text, error) {
        alert('AJAX Error: ' + text + ' | ' + error + ':' + "\n" + req.responseText);
    },
    success: function (json) {
        jxr_decode(json);
    },
    dataType: "json"
});
}

It calls error method and writes: "AJAX Error: error | Error: Invalid argument".

You can test is online here: http://stat.8-800.su (enter any values and press "Войти в статистику" button).

I check in over all internet but not found anything useful. I've tried to set AddDefaultCharset utf-8, nothing happens.

Share Improve this question asked Oct 19, 2011 at 17:20 EpsiloncoolEpsiloncool 1,4731 gold badge19 silver badges41 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

This is a stab, but try using the actually URL instead of the empty string. So

url: '/',
发布评论

评论列表(0)

  1. 暂无评论