I have a code which makes Ajax post using JQuery in asp.net. It worked fine in IE and Chrome but failed in Firefox. When debugged using Firebug it showed 411 “Lenght Required” error. After wasting couple of hours on google it finally turned out a kind of Jquery bug.

Normally I wrote code like:

    $.ajax({ type: “POST”,
        url: “URL”,
        dataType: “xml”,
        processData: true,
        error: function(XMLHttpRequest, textStatus, errorThrown) {},
        success: {}
    });

Looks normal and works in IE and Chrome but not in FF, to make work in FF we have to provide an empty data header like below:

    $.ajax({ type: “POST”,
        url: “URL”,
        dataType: “xml”,
        data:{},
        processData: true,
        error: function(XMLHttpRequest, textStatus, errorThrown) {},
        success: {}
    });

It is weird because there are so many other headers which we don’t pass it too and they are taken with default values and why not with data header.

Hope it will be solved in upcoming jquery releases and till then hope this helps.