0

In order to load result from a POST request (which might take up to a minute or two to complete) while showing the user a load screen I am using an Ajax request. This seems to work fine on Chrome, but on Firefox the request fails with an unspecified error after a few seconds, before the server is able to return the response. This appears to happen especially when the server is running on localhost.

 $(document).ready(function() {
     $.post({
         url: "/analyze/",
         data: {
             "data": "data",
         },
         dataType: "html",
         cache: false,
         timeout: 60000,
         success: function(response) {
             $("#container").html(response);
         },
         error: function(jqXHR, textStatus, errorThrown) {
             $("#status").html("<div>Something failed!</div>");
         }
     });
 });

Any idea how I can resolve this?

C. G.
  • 1

0 Answers0