AJAX https POST requests using jquery fail in Firefox

前端 未结 5 1614
盖世英雄少女心
盖世英雄少女心 2021-02-11 02:03

I have a simple list of records in an HTML table with a delete link for each row. The delete link shoots off an AJAX post request to a fixed url that looks like: \"/delet

相关标签:
5条回答
  • 2021-02-11 02:15

    That seems unlikely... not that I'm doubting you. But I would suggest downloading Wireshark and watching your HTTP traffic to see if you can't isolate the problem. You'll be able to compare the request sent by other browsers against the request sent out by FF3 and see what sort of response is coming back. If it is indeed a problem with jQuery not functioning correctly in FF3 you might be able to alter some of the code to work properly.

    0 讨论(0)
  • 2021-02-11 02:20

    Do you have any plugins or GreaseMonkey scripts installed on your Firefox?

    I have never had issues with jQuery AJAX requests on HTTPS. I'd suggest taking a look at what Firebug turns up if you haven't already.

    0 讨论(0)
  • 2021-02-11 02:20

    You can probably install the Firefox Live Headers extension that will give you access to all the information in your requests/responses. This way you'll be catch any differences.

    0 讨论(0)
  • 2021-02-11 02:24

    I got $.post to work in Firefox by sending an empty object as the data parameter. Notice the empty brackets for parameter 2:

    $.post(url, {}, function(response){ alert('done'); }, "json");
    
    0 讨论(0)
  • 2021-02-11 02:27

    Sounds like you're getting an HTTP 411 error.. This error can happen if you're sending a POST request without any data.

    To fix this, add an empty object ({}) to the data property to your requests:

    $.ajax({ 
        url: url, 
        type: 'POST', 
        data: {}, // <- set empty data 
        success: function(data, textStatus) { 
            // do something 
        } 
    }); 
    
    0 讨论(0)
提交回复
热议问题