2

In FF and IE, I make an Ajax request (Jquery Post) to my server. The requests calls a sql stored procedure which queries for 30 seconds before it returns data (or immediately if data is available). Data is then returned to my javascript and I preform actions based off it.

All is fine, until I get to Chrome, which will get the updates, but shows the loading pointer and loading page icon in the browser.

This call is made each time the request is returned, so it seems - to the user -as if chrome is always waiting for the page to load.

Is there any way around this?

Regards.

Bob
  • 3,074
  • 11
  • 43
  • 62

1 Answers1

1

I recently faced the same issue. Fortunately, I found another SO question that was very useful. Here is an example of what I did to solve the problem:

jQuery(document).ready(function() {
  setTimeout(function () {
   $.getJSON("veryLongRequest", function(json) {
   alert("JSON Result: " + json[0].id);});
  }, 500); // You may need to adjust this to a longer delay.
});

Note: I am using the short-hand jquery method, "getJSON" which is a wrapper for the ajax call with datatype set to "json". However, this solution will work for all ajax requests.

Referenced:

Stop the browser "throbber of doom" while loading comet/server push iframe

Community
  • 1
  • 1
meta.matt
  • 312
  • 1
  • 5
  • 14