08.14JSON Object - Powerful Javascript Notation Overview
I believe most of you have heard about using XML to store data. However, using JSON object to store data in Javascript is the most convenient way as JSON object is native in Javascript programming. An example of JSON object is as following
var myJSON = {
browser: "Firefox 2.0.16",
platform: "Mac OS X",
ipaddress: "127.0.0.1"
}
In myJSON object, we only store 3 pieces of data naming browser, platform and ipaddress. However, you can put in as many data as you would like to store. Each piece of information is constructed by 2 parts: a unique name of data within JSON object (e.g. browser, platform, ipaddress) and the data itself ( e.g. “Firefox 2.0.16″, “Mac OS X”, “127.0.0.1″ ).
Additionally, JSON object can also be nested. For example
var myJSON = {
browser: "Firefox 2.0.16",
platform: "Mac OS X",
ipaddress: "127.0.0.1"
os: {
name: "Mac OS",
version: "X",
cpu: "2.4 ghz"
}
}
os itself is another JSON object nested within myJSON object
You can also store an array in a JSON object, for example
var myJSON = {
browser: "Firefox 2.0.16",
platform: "Mac OS X",
ipaddress: "127.0.0.1"
os: {
name: "Mac OS",
version: "X",
cpu: "2.4 ghz",
compatible_browsers: ["Firefox", "Safari", "Opera"]
}
}
In this example, compatible_browsers is an array of String
A Javascript array itself is also considered as a JSON object but not vice versa, for example arrayJSON itself is an array and a JSON object,
var arrayJSON = ["Firefox", "Safari", "Opera"]
You can even write JSON object as following
var myPlatformsJSON = [
windows: {
default_browser: "Internet Explorer",
compatible_browsers: ["Internet Explorer", "Firefox",
"Safari Beta", "Opera"],
version: "XP"
},
linux: {
default_browser: "Firefox",
compatible_browsers: ["Firefox", "Conqueror", "Opera"],
version: "Ubuntu"
},
macOS: {
default_browser: "Safari",
compatible_browsers: ["Safari", "Firefox", "Opera"],
version: "X"
}
]
By using JSON object, you could store any types of data. Additionally, the data in JSON object is accessible in a surprisingly easy way, which makes JSON object becomes so powerful and extremely popular in AJAX transaction.
Del.icio.us | Digg it | StumbleUpon | BlinkBits | Furl | Ma.gnolia | Newsvine | Reddit

Wow, it’s so complicated that it makes my eyes blurry. But it’s nice to know the fact that JSON object comes this handy. Looking forward to the continuation of this article
August 15th, 2008 at 1:10 am
Skip Hop Studio Diaper Tote Handbag is awesome.So numerous pockets - and not really these little, useless pockets, either. Almost all of the pockets tend to be a fantastic dimension and truly help keep everything organized. The handles are a great length and fit nicely over the shoulder; the handle shoulder straps also stay place on my shoulder, which is important when you are having a newborn. The tote looks wonderful, as well. Not as well fancy, but not too casual. (I have it in black) The material is soft (can’t assume of a far better word) so it’s simple to squeeze in to tight spaces - but yet it’s sturdy. I have a Fleurville Lexi tote and I adore it, too, but that bag is type of inflexible. I believe this Skip*Hop will become my daily tote. It is a bit large - so if you are not really in to large hand bags this might be better as an over-night baby diaper bag.
October 26th, 2010 at 9:33 pm
I lately came across your write-up and have been reading along. I desire to express my admiration of your writing skill and capacity to make readers read from the beginning to the end. I would like to read newer posts and to share my thoughts with you.
September 8th, 2011 at 6:29 am
You made some decent points there. I looked on the internet for the problem and discovered most individuals will go along with with your website.
November 10th, 2011 at 8:11 pm