Archive for the JavaScript Category

Converting a JSON Text to a JavaScript Object

Posted on February 17, 2012 by Comments Off

One of the most common use of JSON is to fetch JSON data from a web server (as a file or as an HttpRequest), convert the JSON data to a JavaScript object, and then use the data in a web page.

For simplicity, this can be demonstrated by using a string as input (instead of a file).


JSON Example – Object From String

Create a JavaScript string containing JSON syntax:

Read on...

Share |


JSON Object

Posted on January 5, 2012 by 1 Comment

JSON, or JavaScript Object Notation, has become a popular alternative to XML for defining structured data using JavaScript. A sample JSON definition that stores some information about Bob may look like the following:

{
“name”: “Bob Miller”,
“age”: 27,
“occupation”: “Programmer”,
“contact”:{
“address”: “253 Johnson Road”,
“Home_Phone”: “544-6443″,
“Cell_Phone”: “563-3566″
}
}

Read on...

Share |


Filed Under: JavaScript