Tnx for the swift reply

I kinda worked around it but i would still like to understand this..
jscript newbie here ;)

I tried this

function divUpdate(id, url, par, val){
  var params = {};
  params[par] = val;
new Ajax.Updater(id, url, {
  method: 'get',
  parameters: params;
  });

but that is obviously not right.
appreciate any help

Cheers


}



On Apr 2, 11:42 pm, Michael Peters <[EMAIL PROTECTED]> wrote:
> CoolJazz wrote:
> > Hi,
>
> > ok, simple question i think.
>
> > I have this update function:
>
> > function divUpdate(id, url, par, val){
> >   new Ajax.Updater(id, url, {
> >   method: 'get',
> >   parameters: {par: val}
>
> Here's your problem. The left hand side of a name-value pair in JSON is a
> literal value. You simply cannot use a variable there. Try something like 
> this:
>
>   var params = {};
>   params[par] = val;
>
> And then later:
>   parameters: params
>
> --
> Michael Peters
> Developer
> Plus Three, LP


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to