Tags:
create new tag
, view all tags

JSON

JSON (pronounced like the English given name Jason), which stands for "JavaScript Object Notation", is a lightweight computer data interchange format. JSON is a subset of the object literal notation of JavaScript but its use does not require JavaScript. JSON's simplicity has resulted in its widespread use, especially in AJAX. In JavaScript, JSON can be parsed trivially using the eval() procedure. This was important for the acceptance of JSON within the AJAX programming community because of JavaScript's ubiquity among web browsers. (from Wikipedia:JSON)

Examples

Examples from http://www.json.org/example.html

----------------------------------------------------
{"menu": {
  "id": "file",
  "value": "File",
  "popup": {
    "menuitem": [
      {"value": "New", "onclick": "CreateNewDoc()"},
      {"value": "Open", "onclick": "OpenDoc()"},
      {"value": "Close", "onclick": "CloseDoc()"}
    ]
  }
}}
----------------------------------------------------
{"widget": {
    "debug": "on",
    "window": {
        "title": "Sample Konfabulator Widget",
        "name": "main_window",
        "width": 500,
        "height": 500
    },
    "image": { 
        "src": "Images/Sun.png",
        "name": "sun1",
        "hOffset": 250,
        "vOffset": 250,
        "alignment": "center"
    },
    "text": {
        "data": "Click Here",
        "size": 36,
        "style": "bold",
        "name": "text1",
        "hOffset": 250,
        "vOffset": 100,
        "alignment": "center",
        "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
    }
}}
----------------------------------------------------

Related Topics:

  • AJAX - acronym for Asynchronous JavaScript and XML
  • JavaScript - scripting language to create dynamic web pages, mainly used browser side
  • XML - eXtensible Markup Language
  • CouchDB - document-oriented database engine using JSON
  • MongoDB - document-oriented database engine using BSON (binary JSON)
  • REST - REpresentational State Transfer protocol

Related Links:

-- Contributors: PeterThoeny - 2012-03-11

Discussion

JSON is one of the hot topics at AJAXWorld conference, Santa Clara, CA, Oct 2006.

-- PeterThoeny - 04 Oct 2006

I am looking for a way to way to write a JSON string from javascript to a topic. Any ideas?

-- ArthurClemens - 06 Nov 2006

That looks pretty easy: Have a look at the JSON stringifier at http://www.json.org/js.html, for download http://www.json.org/json.js. Simply use the toJSONString method to fill a text area, or in a document.write. Or did I miss something?

-- HaraldJoerg - 06 Nov 2006

But will the string be saved in the topic?

-- ArthurClemens - 06 Nov 2006

JSPopupPlugin and InlineEditPlugin use the CPAN JSON module to bring the JSON string into a perl object. Arthur, can you be more specific? saved as a string, or saved somehow differently?

-- SvenDowideit - 06 Nov 2006

I was thinking to TWikify this js outliner: http://www.decafbad.com/2005/07/map-test/tree2.html. Would be nice to save the ouliner every time the input field loses focus.

-- ArthurClemens - 06 Nov 2006

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2012-03-11 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.