chump2877
07-28-2006, 05:55 PM
I've got some AJAX that I'm executing in timed increments in the background of a page....the AJAX is started in the BODY tag's onLoad event handler, and then executes in the background every 5 seconds after the page loads, like so:
<body onLoad="setInterval('whosOnline()',5);">
...where whosOnline() is the JS function that communicates with my server side script (in the background)....The server side script basically checks to see who is online and then returns some HTML to my callback function (which then uses innerHTML to display the results)...
I'm wondering if this is a bad design/implementation of AJAX....I've noticed that the AJAX is slowing down the script, and seems to be hogging resources...in fact, the status bar of the browser indicates that the page has never loaded completely (I absolutely need to eliminate this side effect)....and when I go to another URL, sometimes the new URL doesn;t load properly (like the ongoing AJAX in the background of the preceding page wasn;t terminated properly or something, and prevented loading of the new page?)...and sometimes, the browser crashes when open to the page that is using the AJAX...
Anyway, any of your thoughts or ideas are appreciated...
<body onLoad="setInterval('whosOnline()',5);">
...where whosOnline() is the JS function that communicates with my server side script (in the background)....The server side script basically checks to see who is online and then returns some HTML to my callback function (which then uses innerHTML to display the results)...
I'm wondering if this is a bad design/implementation of AJAX....I've noticed that the AJAX is slowing down the script, and seems to be hogging resources...in fact, the status bar of the browser indicates that the page has never loaded completely (I absolutely need to eliminate this side effect)....and when I go to another URL, sometimes the new URL doesn;t load properly (like the ongoing AJAX in the background of the preceding page wasn;t terminated properly or something, and prevented loading of the new page?)...and sometimes, the browser crashes when open to the page that is using the AJAX...
Anyway, any of your thoughts or ideas are appreciated...