Page 1 of 1
Using JSON
Posted: Sun Sep 10, 2006 6:09 pm
by daedalus__
I've been looking at JSON alot lately.
I just want to take a simple JSON thing:
Code: Select all
var json_obj = {
var:"blah",
var:"blah",
func1: function() {
/* stuff */
},
func2:function() {
/*stuff*/
}
}
and then turn it into an object:
I found one thing that is susposed to help called
json.js but I couldn't get it to work.

Posted: Mon Sep 11, 2006 2:33 am
by n00b Saibot
sn't it already an object itself?
Posted: Mon Sep 11, 2006 11:08 am
by daedalus__
Yes but I want to be able to make copies of it or at least reference it.
Posted: Mon Sep 11, 2006 3:47 pm
by nickvd
JSON is (afaik) used to facilitate the transfer of javascript "items" (objects, arrays, etc) from place to place, i.e. client side to almost any server side language. if you're staying within js, you dont really need json for anything, it's when you want to send (or retrieve, ala google maps geocoder) data.
Or are you trying to take a preformatted json string and convert it into it's javascript form...
Posted: Mon Sep 11, 2006 5:46 pm
by daedalus__
I like JSON because it is beautiful. I read earlier today that JSON objects can only be singletons though I found a little script that will let you turn them into classes; That is what i was looking for in the first place.
It is called Classy JSON.