Re: [jQuery] addclass and json

2007-02-27 Thread Richard Thomas
I used class as an example to show what each variable was. Test code is like this This function is used to process $.getJSON data process(data) { args = data[i].a // data is an array of commands, a = green $('#text').addClass(args); // does not work $('#text').addClass(args.toString()); // doe

Re: [jQuery] addclass and json

2007-02-26 Thread Erik Beeson
> addClass(json.class) addClass and jquery die with no visible error in firebug I've found proper exception handling can help track down "no visible error" type bugs: try { // code here } catch(e) { alert("There was a problem with that code: " + e); } But like Karl said, using "class" is probabl

Re: [jQuery] addclass and json

2007-02-26 Thread Karl Rudd
Sidenote: If you do need to use "class" as an attribute / property name you could access it via: json['class'] Karl Rudd On 2/27/07, Richard Thomas <[EMAIL PROTECTED]> wrote: > I am trying to pass a value to addClass, If I hardcode 'green' it works > if I do var = green > addClass(var) > > I

Re: [jQuery] addclass and json

2007-02-26 Thread Karl Rudd
In JavaScript "class" is a reserved word. Perhaps that's the problem? If not then it'd be best to post a URL to an example page so we can have a look at it. Karl Rudd On 2/27/07, Richard Thomas <[EMAIL PROTECTED]> wrote: > I am trying to pass a value to addClass, If I hardcode 'green' it works >

[jQuery] addclass and json

2007-02-26 Thread Richard Thomas
I am trying to pass a value to addClass, If I hardcode 'green' it works if I do var = green addClass(var) It works If I try to use a value from jquery json data like addClass(json.class) addClass and jquery die with no visible error in firebug If I do json.class.toString() it works, Prior to ve