AJAX https POST requests using jquery fail in Firefox

前端 未结 5 1613
盖世英雄少女心
盖世英雄少女心 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: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 
        } 
    }); 
    

提交回复
热议问题