views:

88

answers:

2

Hi,

On my setup, the ids of all entries will be fetched (e.g. assigned to variable ids=2,5,7,9,11) and passed to periodicalupdater to send to a php script. The problem is that the list of ids change over time, when new entries are added via ajax. How can I make it such that the updated id list of entries will be passed to periodicalupdater at each execution? From my observations, the first time it runs, the data is "cached" or captured and reused again and again and doesn't refetch the variable (ids) before each "execution".

Alternatively, is there another plugin or code that can do this if this can't? I'm just looking to send the list of entry ids to a server script via ajax, which will in turn return a xml file for processing (only if there's any changes) at intervals.

Thanks for your help! :)

A: 

Ah my apologies.

I just realised I can add a function call for the data field instead to make it refetch the variable.

Thanks all :)

Lyon
A: 

Could you put in the code you ran? When I use a function call for the data, it only calls the function the first time the updater runs.

My code:

jQuery.PeriodicalUpdater('myurl.php', {
    method: 'get',
    data: _getUpdateRequestData,
    minTimeout: 10000,
    maxTimeout: 1000000,
    multiplier: 2,
    type: 'json',
    maxCalls: 0,
    autoStop: 0
}, function(data) {
    // Do stuff
});

Any help would be very appreciated! Thanks!

Gromer
Nevermind, I figured it out. Use an anonymous function, and it works fine.
Gromer