jQuery .ajax() call to page method works in FF only when async is false

Posted by Steve on Stack Overflow See other posts from Stack Overflow or by Steve
Published on 2010-06-02T18:48:04Z Indexed on 2010/06/03 0:54 UTC
Read the original article Hit count: 498

Filed under:
|
|
|
|

I'm calling a page method using .ajax() and it works in IE8 whatever the value of async is. However, in FF3.6, it only works with async set to false. When async is set to true, in Firebug, I just see status aborted. The page validates. I can work with async set to false, but any clues as to why FF can't work with async set to true?

$("[id$='_www']").click(function() {

    var hhh = false;

    $.ajax({
        async: false,
        cache: false,
        type: "POST",
        url: "/abc/def.aspx/jkl",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        data: "{ 'eee': '"
            + window.location.href.match(/\d{1,3}$/)
            + "', 'ttt': '"
            + $("[id$='_zzz']").val()
            + "' }",
        success: function(msg) {
            $("#ggg").html(msg.d);
        },
        error: function(xhr, err) {
            hhh = true;
        }
    });

    return hhh;

});

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about jQuery