Thursday, December 29, 2011

Javascript: Hiding Button By ID

from http://www.coderanch.com/t/121579/HTML-CSS-JavaScript/hide-button-javascript

how to hide button using javascript

hani Ibrahim
Ranch Hand

Joined: Sep 06, 2006
Posts: 171 
Dear all,
i have 3 buttons X,Y,Z what i want:
1) initially to hide Y,Z and show X
2)if i press on Y i hideX and Z
3) if i press on Z show just X
how is that please
Daesung Park
Ranch Hand

Joined: Mar 22, 2007
Posts: 68 
You can set "visibility" property of style.
  1.  document.getElementById('x').style.visibility='hidden'// hide  
  2. document.getElementById('x').style.visibility='visible'// show   

Wednesday, December 14, 2011

Windows 8 Blog and Developer Preview Forums


Some other great jump off points


        Windows 8 Blog http://blogs.msdn.com/b/b8/
·          MSDN for developer information http://dev.windows.com
·          Windows Developer Preview: Metro Style Applications Forum
·          Windows Developer Preview: Desktop Development Forum
·          Windows Developer Preview: Hardware Development Foru

Javascript: JSDB Javascript for Databases

from  http://www.jsdb.org/

"As a general-purpose scripting environment I have found JSDB ... to be a superbly powerful and extensible environment for managing batch tasks." — A. M.

JSDB is JavaScript for databases, a scripting language for data-driven, network-centric programming on Windows, Mac, Linux, and SunOS. JSDB works with databases, XML, the web, and email. It is free and open-source. Use it as a JavaScript shell, to run CGI programs, or as a web server.

Start here

Download JSDB for Windows.
Unzip the package anywhere on your computer.
Double-click the JSDB icon.
Then,
  1. Add theJSDB® developers' sidebar to your web browser.
  2. Click here, and follow along.
  3. Re-introduce yourself to JavaScript.
  4. Join the JSDB group on Google
    Email:  
  5. Play around with a web user interface or grid programming.

September 22, 2011
  • Updated grid toolkit September 12, 2011
  • Version 1.8.0.6
  • Changelog

  • Cool stuff
  • Grid programming toolkit
  • Web user interface toolkit
  • Personal wiki

  • Learn more

    1. Read the Tutorialstudy the Cookbook, or hack the source.
    2. Try the web-baseed remote debugger.
    3. Get involved! Read the release notesSend me something cool you wrote!
    For 17 years, I have been building a powerful, robust C++ class library to support my commercial electronic form software. But I wanted something more flexible than compiled code — something that would let me improvise quick solutions, without all the hassle of setting compiler options. It would have to be self contained, capable of running with no DLLs or libraries to worry about. I scoured the internet, but I couldn't find anything that would fit the bill. I was afraid that I would have to write my own computer language — until I discovered Mozilla's JavaScript! It's open-source, has generous license terms, and is actively maintained by the language's inventor, Brendan Eich. This led me to create JSDB®, an interactive JavaScript interpreter, extended with powerful data-manipulation tools.

    JSDB® uses the same language interpeter as FireFox (including E4X) to give you high-level control over powerful classes for databases, email, networking, and XML. Now, without ever firing up my compiler, I can write simple (and even complex) programs in 1/10th the time it used to take me with C++! I'm thrilled with JSDB, and I want to share it with you. It's open source, it's free to download, and it's unencumbered by IP claims. And I've just added a powerful graphical debugger to make it even easier to write network-centric programs with JSDB. I hope you like it!

    About

    JSDB® is a JavaScript shell designed with network-centric programming in mind. It can be used as a database interface, XML processor, and internet-oriented scripting language. JSDB can do nearly any batch processing task that Visual Basic can do, and it has drivers to let you read and send email, query a MySQL database, and run regular expression searches, without having to learn a specific SQL syntax or install a bunch of ActiveX components. JSDB has everything you need to write a web server or database middleware, with a graphical debugger, itself written in JSDB.

    Examples

    A bulk mailer, using a desktop web GUI.Visual, customizable, remote debugger

    What is it?

    JSDB is based on Mozilla SpiderMonkey and class libraries developed by Raosoft, Inc. The open-source version is free with fairly generous license terms. Additional functionality or even less restrictive license terms may be purchased from Raosoft, Inc.
    JSDB can treat any DBF/xBase, ASCII, Oracle, Sybase, DB/2, Postgres, MySql, Access, or Microsoft SQL Server table equivalently, translating high-level (set(row,field,value), get(row,field)) function calls to database-specific SQL commands. The same applies to email: you can communicate with Lotus Notes, Exchange (MAPI), and SMTP/POP3 mail systems interchangably with a single set of function calls.
    JSDB also includes a stream object that gives you a common interface to files, COM ports, sockets, HTTP, pipes, and memory. The ability to treat memory as if it were a file helps you write reusable code that is easily adapted to a variety of situations.
    For writing distributed XML web applications, JSDB comes with an Internet server component and an XML parser, both implemented in a balance of C++ and JavaScript for optimum speed and flexibility.
    You might use JSDB to:
    • translate XML into SQL statements,
    • translate SQL databases into XML,
    • generate HTML documentation from an XML or Oracle database,
    • download web pages while you sleep,
    • index their contents in a database,
    • send personalized email based on a database,
    • or run a web database
    It includes a simple and fault-tolerant XML parser library, and a specialized parser for EFS forms used by Raosoft's EZSurvey and InterForm programs.

    Pricing

    You can download JSDB and use it for free. You can give it to a friend, and she can use it for free, too. You can even sell JSDB, but check the license terms first. To show your gratitude, please contribute your own useful or thought-provoking creations to the public domain. JSDB is based on the public-spirited contributions of many people who believe in sharing.

    Legal

    JSDB is a registered trademark of Shanti Rao. Raosoft is a registered trademark of Raosoft, Inc. The name JSDB may only be used to describe the software downloaded from this web site. Any alterations, including embedding in other programs, may not be called JSDB without the prior written permission of Raosoft, Inc.
    JSDB has no warranty, express or implied. Don't use it for medical devices or avionics.
    JSDB is subject to certain license terms which apply if you redistribute it in whole or part (including derived works). Contact us to purchase a CD with less restrictive license (for bundling with a closed-source product, for instance) from Raosoft, Inc. Prices are reasonable, starting at $50.
    Please see the license for warranty and limited liability statements.

    Get JSDB

    Click here to download JSDB and start exploring today!

    As demonstrated here (pay video) by pluralsight , you can use it like the old fashioned command line BASIC interpreter style:

    jsdb
    js> writeln("Hello World");
    Hello World
    js>var i - 1;
    js>var j = 3;
    js>i + j;
    4
    js>^c
    // ^c exits
    // execute script from file
    jsdb hello.js

    // use load to execute script from command line
    >jsdb
    >load ("hello.js");
    Hello World
    true




    Javascript: JSON Sample Code

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

    It's basically just a list of name / value pairs encoded for Javascript. Pretty simple minded but it does the job

    JSON Example



    This page shows examples of messages formatted using JSON (JavaScript Object Notation).

    {
        "glossary": {
            "title": "example glossary",
      "GlossDiv": {
                "title": "S",
       "GlossList": {
                    "GlossEntry": {
                        "ID": "SGML",
         "SortAs": "SGML",
         "GlossTerm": "Standard Generalized Markup Language",
         "Acronym": "SGML",
         "Abbrev": "ISO 8879:1986",
         "GlossDef": {
                            "para": "A meta-markup language, used to create markup languages such as DocBook.",
          "GlossSeeAlso": ["GML", "XML"]
                        },
         "GlossSee": "markup"
                    }
                }
            }
        }
    }
    
    The same text expressed as XML:
    <!DOCTYPE glossary PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
     <glossary><title>example glossary</title>
      <GlossDiv><title>S</title>
       <GlossList>
        <GlossEntry ID="SGML" SortAs="SGML">
         <GlossTerm>Standard Generalized Markup Language</GlossTerm>
         <Acronym>SGML</Acronym>
         <Abbrev>ISO 8879:1986</Abbrev>
         <GlossDef>
          <para>A meta-markup language, used to create markup
    languages such as DocBook.</para>
          <GlossSeeAlso OtherTerm="GML">
          <GlossSeeAlso OtherTerm="XML">
         </GlossDef>
         <GlossSee OtherTerm="markup">
        </GlossEntry>
       </GlossList>
      </GlossDiv>
     </glossary>
    

    {"menu": {
      "id": "file",
      "value": "File",
      "popup": {
        "menuitem": [
          {"value": "New", "onclick": "CreateNewDoc()"},
          {"value": "Open", "onclick": "OpenDoc()"},
          {"value": "Close", "onclick": "CloseDoc()"}
        ]
      }
    }}
    The same text expressed as XML:
    <menu id="file" value="File">
      <popup>
        <menuitem value="New" onclick="CreateNewDoc()" />
        <menuitem value="Open" onclick="OpenDoc()" />
        <menuitem value="Close" onclick="CloseDoc()" />
      </popup>
    </menu>

    {"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;"
        }
    }}    
    The same text expressed as XML:
    <widget>
        <debug>on</debug>
        <window title="Sample Konfabulator Widget">
            <name>main_window</name>
            <width>500</width>
            <height>500</height>
        </window>
        <image src="Images/Sun.png" name="sun1">
            <hOffset>250</hOffset>
            <vOffset>250</vOffset>
            <alignment>center</alignment>
        </image>
        <text data="Click Here" size="36" style="bold">
            <name>text1</name>
            <hOffset>250</hOffset>
            <vOffset>100</vOffset>
            <alignment>center</alignment>
            <onMouseUp>
                sun1.opacity = (sun1.opacity / 100) * 90;
            </onMouseUp>
        </text>
    </widget>

    {"web-app": {
      "servlet": [   
        {
          "servlet-name": "cofaxCDS",
          "servlet-class": "org.cofax.cds.CDSServlet",
          "init-param": {
            "configGlossary:installationAt": "Philadelphia, PA",
            "configGlossary:adminEmail": "ksm@pobox.com",
            "configGlossary:poweredBy": "Cofax",
            "configGlossary:poweredByIcon": "/images/cofax.gif",
            "configGlossary:staticPath": "/content/static",
            "templateProcessorClass": "org.cofax.WysiwygTemplate",
            "templateLoaderClass": "org.cofax.FilesTemplateLoader",
            "templatePath": "templates",
            "templateOverridePath": "",
            "defaultListTemplate": "listTemplate.htm",
            "defaultFileTemplate": "articleTemplate.htm",
            "useJSP": false,
            "jspListTemplate": "listTemplate.jsp",
            "jspFileTemplate": "articleTemplate.jsp",
            "cachePackageTagsTrack": 200,
            "cachePackageTagsStore": 200,
            "cachePackageTagsRefresh": 60,
            "cacheTemplatesTrack": 100,
            "cacheTemplatesStore": 50,
            "cacheTemplatesRefresh": 15,
            "cachePagesTrack": 200,
            "cachePagesStore": 100,
            "cachePagesRefresh": 10,
            "cachePagesDirtyRead": 10,
            "searchEngineListTemplate": "forSearchEnginesList.htm",
            "searchEngineFileTemplate": "forSearchEngines.htm",
            "searchEngineRobotsDb": "WEB-INF/robots.db",
            "useDataStore": true,
            "dataStoreClass": "org.cofax.SqlDataStore",
            "redirectionClass": "org.cofax.SqlRedirection",
            "dataStoreName": "cofax",
            "dataStoreDriver": "com.microsoft.jdbc.sqlserver.SQLServerDriver",
            "dataStoreUrl": "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon",
            "dataStoreUser": "sa",
            "dataStorePassword": "dataStoreTestQuery",
            "dataStoreTestQuery": "SET NOCOUNT ON;select test='test';",
            "dataStoreLogFile": "/usr/local/tomcat/logs/datastore.log",
            "dataStoreInitConns": 10,
            "dataStoreMaxConns": 100,
            "dataStoreConnUsageLimit": 100,
            "dataStoreLogLevel": "debug",
            "maxUrlLength": 500}},
        {
          "servlet-name": "cofaxEmail",
          "servlet-class": "org.cofax.cds.EmailServlet",
          "init-param": {
          "mailHost": "mail1",
          "mailHostOverride": "mail2"}},
        {
          "servlet-name": "cofaxAdmin",
          "servlet-class": "org.cofax.cds.AdminServlet"},
     
        {
          "servlet-name": "fileServlet",
          "servlet-class": "org.cofax.cds.FileServlet"},
        {
          "servlet-name": "cofaxTools",
          "servlet-class": "org.cofax.cms.CofaxToolsServlet",
          "init-param": {
            "templatePath": "toolstemplates/",
            "log": 1,
            "logLocation": "/usr/local/tomcat/logs/CofaxTools.log",
            "logMaxSize": "",
            "dataLog": 1,
            "dataLogLocation": "/usr/local/tomcat/logs/dataLog.log",
            "dataLogMaxSize": "",
            "removePageCache": "/content/admin/remove?cache=pages&id=",
            "removeTemplateCache": "/content/admin/remove?cache=templates&id=",
            "fileTransferFolder": "/usr/local/tomcat/webapps/content/fileTransferFolder",
            "lookInContext": 1,
            "adminGroupID": 4,
            "betaServer": true}}],
      "servlet-mapping": {
        "cofaxCDS": "/",
        "cofaxEmail": "/cofaxutil/aemail/*",
        "cofaxAdmin": "/admin/*",
        "fileServlet": "/static/*",
        "cofaxTools": "/tools/*"},
     
      "taglib": {
        "taglib-uri": "cofax.tld",
        "taglib-location": "/WEB-INF/tlds/cofax.tld"}}}
    The same file expressed as XML:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    
    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
        "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
    <web-app>
        <servlet>
            <servlet-name>
                cofaxCDS
            </servlet-name>
            <servlet-class>
                org.cofax.cds.CDSServlet
            </servlet-class>
    
             <init-param>
              <param-name>configGlossary:installationAt</param-name>
          <param-value>Philadelphia, PA</param-value>
            </init-param>
            <init-param>
              <param-name>configGlossary:adminEmail</param-name>
          <param-value>ksm@pobox.com</param-value>
            </init-param>
            <init-param>
              <param-name>configGlossary:poweredBy</param-name>
          <param-value>Cofax</param-value>
            </init-param>
            <init-param>
              <param-name>configGlossary:poweredByIcon</param-name>
          <param-value>/images/cofax.gif</param-value>
            </init-param>
            <init-param>
              <param-name>configGlossary:staticPath</param-name>
          <param-value>/content/static</param-value>
            </init-param>
    
         <init-param>
              <param-name>templateProcessorClass</param-name>
          <param-value>org.cofax.WysiwygTemplate</param-value>
            </init-param>
    
        <init-param>
              <param-name>templateLoaderClass</param-name>
          <param-value>org.cofax.FilesTemplateLoader</param-value>
            </init-param>
    
             <init-param>
              <param-name>templatePath</param-name>
          <param-value>templates</param-value>
            </init-param>
    
            <init-param>
              <param-name>templateOverridePath</param-name>
          <param-value></param-value>
            </init-param>
    
         <init-param>
              <param-name>defaultListTemplate</param-name>
          <param-value>listTemplate.htm</param-value>
            </init-param>
    
           <init-param>
              <param-name>defaultFileTemplate</param-name>
          <param-value>articleTemplate.htm</param-value>
            </init-param>
    
           <init-param>
              <param-name>useJSP</param-name>
          <param-value>false</param-value>
            </init-param>
    
        <init-param>
              <param-name>jspListTemplate</param-name>
          <param-value>listTemplate.jsp</param-value>
            </init-param>
    
           <init-param>
              <param-name>jspFileTemplate</param-name>
          <param-value>articleTemplate.jsp</param-value>
            </init-param>
    
         <init-param>
              <param-name>cachePackageTagsTrack</param-name>
          <param-value>200</param-value>
            </init-param>
    
        <init-param>
              <param-name>cachePackageTagsStore</param-name>
          <param-value>200</param-value>
            </init-param>
    
        <init-param>
              <param-name>cachePackageTagsRefresh</param-name>
          <param-value>60</param-value>
            </init-param>
    
         <init-param>
              <param-name>cacheTemplatesTrack</param-name>
          <param-value>100</param-value>
            </init-param>
    
        <init-param>
              <param-name>cacheTemplatesStore</param-name>
          <param-value>50</param-value>
            </init-param>
    
        <init-param>
              <param-name>cacheTemplatesRefresh</param-name>
          <param-value>15</param-value>
            </init-param>
    
        <init-param>
              <param-name>cachePagesTrack</param-name>
          <param-value>200</param-value>
            </init-param>
    
        <init-param>
              <param-name>cachePagesStore</param-name>
          <param-value>100</param-value>
            </init-param>
    
        <init-param>
              <param-name>cachePagesRefresh</param-name>
          <param-value>10</param-value>
            </init-param>
    
        <init-param>
              <param-name>cachePagesDirtyRead</param-name>
          <param-value>10</param-value>
            </init-param>
    
         <init-param>
              <param-name>searchEngineListTemplate</param-name>
          <param-value>forSearchEnginesList.htm</param-value>
            </init-param>
    
           <init-param>
              <param-name>searchEngineFileTemplate</param-name>
          <param-value>forSearchEngines.htm</param-value>
            </init-param>
    
           <init-param>
              <param-name>searchEngineRobotsDb</param-name>
          <param-value>WEB-INF/robots.db</param-value>
            </init-param>
    
        <init-param>
              <param-name>useDataStore</param-name>
          <param-value>true</param-value>
            </init-param>
    
         <init-param>
              <param-name>dataStoreClass</param-name>
          <param-value>org.cofax.SqlDataStore</param-value>
            </init-param>
    
            <init-param>
              <param-name>redirectionClass</param-name>
          <param-value>org.cofax.SqlRedirection</param-value>
            </init-param>
            <init-param>
              <param-name>dataStoreName</param-name>
          <param-value>cofax</param-value>
            </init-param>
    
            <init-param>
              <param-name>dataStoreDriver</param-name>
          <param-value>com.microsoft.jdbc.sqlserver.SQLServerDriver</param-value>
            </init-param>
    
             <init-param>
              <param-name>dataStoreUrl</param-name>
          <param-value>jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon</param-value>
            </init-param>
    
            <init-param>
              <param-name>dataStoreUser</param-name>
          <param-value>sa</param-value>
            </init-param>
    
             <init-param>
              <param-name>dataStorePassword</param-name>
          <param-value></param-value>
            </init-param>
    
             <init-param>
              <param-name>dataStoreTestQuery</param-name>
          <param-value>SET NOCOUNT ON;select test='test';</param-value>
            </init-param>
    
             <init-param>
              <param-name>dataStoreLogFile</param-name>
          <param-value>/usr/local/tomcat/logs/datastore.log</param-value>
            </init-param>
    
             <init-param>
              <param-name>dataStoreInitConns</param-name>
          <param-value>10</param-value>
            </init-param>
    
             <init-param>
              <param-name>dataStoreMaxConns</param-name>
          <param-value>100</param-value>
            </init-param>
    
             <init-param>
              <param-name>dataStoreConnUsageLimit</param-name>
          <param-value>100</param-value>
            </init-param>
     <init-param>
              <param-name>dataStoreLogLevel</param-name>
          <param-value>debug</param-value>
            </init-param>
    
         <init-param>
              <param-name>maxUrlLength</param-name>
          <param-value>500</param-value>
            </init-param>
    
        </servlet>
    
         <servlet>
            <servlet-name>
                cofaxEmail
            </servlet-name>
            <servlet-class>
                org.cofax.cds.EmailServlet
            </servlet-class>
    
             <init-param>
              <param-name>mailHost</param-name>
          <param-value>mail1</param-value>
            </init-param>
    
            <init-param>
              <param-name>mailHostOverride</param-name>
          <param-value>mail2</param-value>
            </init-param>
        </servlet>
    
        <servlet>
            <servlet-name>
                cofaxAdmin
            </servlet-name>
            <servlet-class>
                org.cofax.cds.AdminServlet
            </servlet-class>
        </servlet>
    
        <servlet>
             <servlet-name>
                 fileServlet
             </servlet-name>
             <servlet-class>
                 org.cofax.cds.FileServlet
             </servlet-class>
        </servlet>
    
       <servlet>
            <servlet-name>
                cofaxTools
            </servlet-name>
            <servlet-class>
                org.cofax.cms.CofaxToolsServlet
            </servlet-class>
    
             <init-param>
              <param-name>templatePath</param-name>
              <param-value>toolstemplates/</param-value>
            </init-param>
    
             <init-param>
              <param-name>log</param-name>
              <param-value>1</param-value>
            </init-param>
    
             <init-param>
              <param-name>logLocation</param-name>
              <param-value>/usr/local/tomcat/logs/CofaxTools.log</param-value>
            </init-param>
    
             <init-param>
              <param-name>logMaxSize</param-name>
              <param-value></param-value>
            </init-param>
    
             <init-param>
              <param-name>dataLog</param-name>
              <param-value>1</param-value>
            </init-param>
    
             <init-param>
              <param-name>dataLogLocation</param-name>
              <param-value>/usr/local/tomcat/logs/dataLog.log</param-value>
            </init-param>
    
             <init-param>
              <param-name>dataLogMaxSize</param-name>
              <param-value></param-value>
            </init-param>
    
             <init-param>
              <param-name>removePageCache</param-name>
              <param-value>/content/admin/remove?cache=pages&id=</param-value>
            </init-param>
    
             <init-param>
              <param-name>removeTemplateCache</param-name>
              <param-value>/content/admin/remove?cache=templates&id=</param-value>
            </init-param>
    
             <init-param>
              <param-name>fileTransferFolder</param-name>
              <param-value>/usr/local/tomcat/webapps/content/fileTransferFolder</param-value>
            </init-param>
    
             <init-param>
              <param-name>lookInContext</param-name>
              <param-value>1</param-value>
            </init-param>
    
            <init-param>
              <param-name>adminGroupID</param-name>
              <param-value>4</param-value>
            </init-param>
    
            <init-param>
              <param-name>betaServer</param-name>
              <param-value>true</param-value>
            </init-param>
    
        </servlet>
    
        <servlet-mapping>
        <servlet-name>
        cofaxCDS
        </servlet-name>
        <url-pattern>
        /
        </url-pattern>
        </servlet-mapping>
    
        <servlet-mapping>
        <servlet-name>
        cofaxEmail
        </servlet-name>
        <url-pattern>
        /cofaxutil/aemail/*
        </url-pattern>
        </servlet-mapping>
    
        <servlet-mapping>
            <servlet-name>
            cofaxAdmin
            </servlet-name>
            <url-pattern>
            /admin/*
            </url-pattern>
        </servlet-mapping>
    
        <servlet-mapping>
             <servlet-name>
             fileServlet
             </servlet-name>
             <url-pattern>
             /static/*
             </url-pattern>
         </servlet-mapping>
    
      <servlet-mapping>
            <servlet-name>
            cofaxTools
            </servlet-name>
            <url-pattern>
            /tools/*
            </url-pattern>
        </servlet-mapping>
    
       <taglib>
          <taglib-uri>cofax.tld</taglib-uri>
          <taglib-location>/WEB-INF/tlds/cofax.tld</taglib-location>
       </taglib>
    
    </web-app>
    

    The action and label values only need to be provided if they are not the same as the id.
    {"menu": {
        "header": "SVG Viewer",
        "items": [
            {"id": "Open"},
            {"id": "OpenNew", "label": "Open New"},
            null,
            {"id": "ZoomIn", "label": "Zoom In"},
            {"id": "ZoomOut", "label": "Zoom Out"},
            {"id": "OriginalView", "label": "Original View"},
            null,
            {"id": "Quality"},
            {"id": "Pause"},
            {"id": "Mute"},
            null,
            {"id": "Find", "label": "Find..."},
            {"id": "FindAgain", "label": "Find Again"},
            {"id": "Copy"},
            {"id": "CopyAgain", "label": "Copy Again"},
            {"id": "CopySVG", "label": "Copy SVG"},
            {"id": "ViewSVG", "label": "View SVG"},
            {"id": "ViewSource", "label": "View Source"},
            {"id": "SaveAs", "label": "Save As"},
            null,
            {"id": "Help"},
            {"id": "About", "label": "About Adobe CVG Viewer..."}
        ]
    }}
    
    The same message expressed as XML:
    <menu>
        <header>Adobe SVG Viewer</header>
        <item action="Open" id="Open">Open</item>
        <item action="OpenNew" id="OpenNew">Open New</item>
        <separator/>
        <item action="ZoomIn" id="ZoomIn">Zoom In</item>
        <item action="ZoomOut" id="ZoomOut">Zoom Out</item>
        <item action="OriginalView" id="OriginalView">Original View</item>
        <separator/>
        <item action="Quality" id="Quality">Quality</item>
        <item action="Pause" id="Pause">Pause</item>
        <item action="Mute" id="Mute">Mute</item>
        <separator/>
        <item action="Find" id="Find">Find...</item>
        <item action="FindAgain" id="FindAgain">Find Again</item>
        <item action="Copy" id="Copy">Copy</item>
        <item action="CopyAgain" id="CopyAgain">Copy Again</item>
        <item action="CopySVG" id="CopySVG">Copy SVG</item>
        <item action="ViewSVG" id="ViewSVG">View SVG</item>
        <item action="ViewSource" id="ViewSource">View Source</item>
        <item action="SaveAs" id="SaveAs">Save As</item>
        <separator/>
        <item action="Help" id="Help">Help</item>
        <item action="About" id="About">About Adobe CVG Viewer...</item>
    </menu>

    Javascript: JSON Lightweight data-interchange format

    from http://www.json.org/

    next see sample

    Introducing JSON




    object
    {}
    { members }
    members
    pair
    pair , members
    pair
    string : value
    array
    []
    [ elements ]
    elements
    value
    value , elements
    value
    string
    number
    object
    array
    true
    false
    null

    string
    ""
    " chars "
    chars
    char
    char chars
    char
    any-Unicode-character-
        except-"-or-\-or-
        control-character
    \"
    \\
    \/
    \b
    \f
    \n
    \r
    \t
    \u four-hex-digits
    number
    int
    int frac
    int exp
    int frac exp
    int
    digit
    digit1-9 digits
    - digit
    - digit1-9 digits
    frac
    . digits
    exp
    e digits
    digits
    digit
    digit digits
    e
    e
    e+
    e-
    E
    E+
    E-
    JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming LanguageStandard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.
    JSON is built on two structures:
    • A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
    • An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.
    These are universal data structures. Virtually all modern programming languages support them in one form or another. It makes sense that a data format that is interchangeable with programming languages also be based on these structures.
    In JSON, they take on these forms:
    An object is an unordered set of name/value pairs. An object begins with { (left brace) and ends with } (right brace). Each name is followed by : (colon) and the name/value pairs are separated by , (comma).
    An array is an ordered collection of values. An array begins with [ (left bracket) and ends with ] (right bracket). Values are separated by , (comma).
    value can be a string in double quotes, or a number, or true or false or null, or an object or an array. These structures can be nested.
    string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. A character is represented as a single character string. A string is very much like a C or Java string.
    number is very much like a C or Java number, except that the octal and hexadecimal formats are not used.
    Whitespace can be inserted between any pair of tokens. Excepting a few encoding details, that completely describes the language.