I have a page on which I list the hardware devices that we control for clients. Each displayed line also shows the status of the device, i.e. whether it is working, paused, started, etc.
To improve page load time, I list the devices, but do not request their status until the page is displayed. This is due to the fact that some requests, for example, through SNMP or another API, can take up to 5-10 seconds. Thus, for a list of ten devices, this can take more than a minute when a user looks at a blank page. So I do the following:
On the device list page, I have the following script:
$(document).ready(function () { var devices = $('div[name="runStatus"]'); devices.each(function () {
What I find is that if I allow this script to run, all links on the page become unresponsive.
I suppose this is due to the fact that I have quite a few concurrent asynchronous requests blocking until they get a response from the server, and is somehow blocked by this "UI thread"?
However, I thought this should not happen with AJAX.
I find this โblockingโ behavior in IE8, Chrome 8.0, and Firefox 3.6. Chrome actually shows the arrow + spinning-toilet-death (I use Windows 7), as if the page was not fully displayed.
How can i fix this?
javascript jquery ajax
Kev Dec 05 '10 at 16:48 2010-12-05 16:48
source share