Web page full of different Ajax requests with different refresh intervals

Web page full of different Ajax requests with different refresh intervals

Hi,

I've developed a specialised web server. It is capable of serving up a list of different values from attached engineering systems but, at the moment, it needs Ajaxifying and I will be doing the work using jQuery.

The idea is that a single web page might contain a few dozen Ajax URLs which are refreshed at potentially different intervals (e.g. anything from 5 to 30 seconds, to be specified by the engineer who composes the web page). As the values are collected, the jQuery will simply drop the values into specific DOM elements (paragraphs, divs, or whatever).

Now, I know how to do the individual bits of this, i.e. the Ajax GET, how to handle the response, and how to auto-refresh.

However, what I'm looking for (given I'm not all that hot on Javascript) is how I would go about making the thing data-driven in the <script> block. In other words, it would be great if, when the web page loads, there is an array containing an entry for each URL to fetch the data, the id of the element on the page for which to replace the text, and the interval in milliseconds. In other words, I want to try to design a document.ready block that DOESN'T contain a different function to handle every single Ajax URL request on the page, but a universal small set of functions that can be parameterised and 'fed' from the declared array -- this is the bit I'm rusty on.

Can anyone point me at any hints and tips ?

Thanks