Skip to content

May 17, 2010

2

Note on changing Ajax.PeriodicalUpdater parameters

by Joe Kuan

Sometimes you may have a Ajax.PeriodicalUpdater object running in the background and you need to change the parameter of the page.

To do that, simply change the Ajax.PeriodicalUpdater.options.parameters field, not AjaxPeriodicalUpdater.parameters.

var pu = new Ajax.PeriodicalUpdater(element, 'page.php',
                      { method: 'get',
                        parameters: { arg: val, arg1: val1 }
                      });
pu.options.parameters = { arg2: val2, arg3: val3 };

Don’t assign options.parameters directly with query string. Do the following instead:

var qstr = "arg2=val2&arg3=val3";
pu.options.parameters = qstr.toQueryParams();
2 Comments Post a comment
  1. Attic
    Oct 20 2010

    Thanks a lot, had this exact problem and solved it thanks to your solution.

    Reply
  2. ben
    Nov 8 2010

    thanks! helped me a lot!!!

    where’s your flattr button? :)

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments

%d bloggers like this: