JSON (JavaScript Object Notation) is a lightweight data interchange format. It is based on a subset of ECMAScript. JSON takes a completely language-independent text format, but also uses a similar idiom to the C language family (c, C + +, C #, Java, JavaScript, Perl, Python, and so on). These features make JSON an ideal data exchange language. Easy to read and write, but also easy to machine parse and generate (typically used to improve network transfer rates).
The JSON syntax is a subset of the JavaScript object representation syntax.
- Data in key-value pairs
- Data is separated by commas
- Curly braces Save Object
- Square brackets Save Array
Cases:
1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4 <MetaCharSet= "UTF-8">5 <title>Document</title>6 </Head>7 <Body>8 9 </Body>Ten <Scripttype= "Text/javascript"> One varJSON={ A A:"Hello", - B:" World", - C:123, the D:array (1,2,3,4), - E:{AA:"JSON"} - }//equivalent to an associative array - alert (a); + Alert (json.d[0]); - alert (JSON.D); + alert (JSON.E.AA); A </Script> at </HTML>
Figure:
Pop-up window:
2016/4/2 Lightweight Data Interchange Format examples in Json:js and jquery: Window popup Popwindow