Michael Geary wrote:
> > I figured it out know.  You got to look at the constructor type to see
> > if its an Object, Array or String.   From there you can decide to use
> > for each or for in or for loop.
>
> You don't have to write that code yourself:
>
> http://jollytoad.googlepages.com/json.js

Yeah sure. but 90% of the battle is always understanding other
people's code.  For me to master a language (in this case JS/jQuery),
I have to roll my own, trial and error, live and learn, understanding
the basis and then I would be able to say "ahhhh, ok, I can understand
how this.js or that.js relates and how I can use it or not use it.
Too much overhead". etc

> Description from the plugins page (http://docs.jquery.com/Plugins):
>
> hacked the original json.js into a jQuery plugin. It adds the two
> functions:$.toJSON(value),$.parseJSON(json_str, [safe]).
>
> See the code for more details.

Thanks I will.   More to my point above.

IE doesn't like:

    json = {};

but will accept:

   var json = {};

Also, I did try the original json.js from json.org and there I learned
that I needed to understand another concept - pulling just the array
from a jQuery result. This is because the JSON parser was creating
json for all the properties.  I then realized the jQuery .get() method
purpose in life.

Thanks mike.

Reply via email to