json.com
域名年龄: 22年9个月28天HTTP/1.1 200 OK 服务器:cloudflare-nginx 访问时间:2014年05月17日 08:52:11 类型:text/html; charset=utf-8 Transfer-Encoding: chunked 连接:keep-alive 设置Cookie:__cfduid=d47b9c8b4006ded15b291025f1338f5021400287930951; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.json.com; HttpOnly 语言环境:Express CF-RAY: 12bbd4b070a20663-SJC Content-Encoding: gzip 网站编码:utf-8
json.com { }The Basics100 Awesome UsesJSON– Why JSON?– Why not XML?Examples– Array– Array w/ objects– Object– Objfect w/ nested array– Object w/ nested object– Object w/nested arrays & objectsData Types– Number– String– Boolean– Array– Object– Null– UndefinedResources» jsondata.com » jsonlint.comCredits» Dave Romero» json.org» opendomain.orgJSON (JavaScript Object Notation)JSON is a light-weight text-based open standard designed for human-readable data. It is the most widely used format for interchanging data on the web. It originates from the JavaScript language and is represented with two primary data structures: ordered lists (recognized as 'arrays') and name/value pairs (recognized as 'objects').Why JSON?The JSON standard is language-independent and its data structures, arrays and objects, are universally recognized. These structures are supported in some way by nearly all modern programming languages and are familiar to nearly all programmers. These qualities make it an ideal format for data interchange on the web.Why Not XML?The XML specification does not match the data model for most programming languages which makes it slow and tedious for programmers to parse. Compared to JSON, XML has a low data-to-markup ratio which results in it being more difficult for humans to read and write.ExamplesArrayArray elements are generally of a basic type (number, string, boolean, or null), however can also be a nested array or object (see Data Structures). Elements are comma-delimited and contained within brackets.var myArray = [ "John Doe", 29, true, null ];var arrayNesting = [ [], {} ];myArray[2]trueArray with objectsThis array contains comma-delimited objects which each contain multiple comma-delimited key/value pairs. Objects within an array can be accessed using the array name and index.var myArray = [{ "name": "John Doe", "age": 29 }, { "name": "Anna Smith", "age": 24 }, { "name": "Peter Jones", "age": 39 }];myArray[0].nameJohn DoeObjectThis object contains multiple comma-delimited key/value pairs. Object properties can be accessed using the the object name followed by a period and property name -or- can be accessed like an array using the property name in quotes (in place of an index).var myObject = {"first": "John","last": "Doe","age": 39,"sex": "M","salary": 70000,"registered": true};
myObject.salary70000myObject["salary"]70000Object with nested arrayThis object contains multiple comma-delimited key/value pairs and a nested array. The nested array can be accessed with the object name, property or 'key' containing the array and an array index.var myObject = {
"first": "John",
"last": "Doe",
"age": 39,
"sex": "M",
"salary": 70000,
"registered": true,
"interests": [ "Reading", "Mountain Biking", "Hacking" ]
};
myObject.interests[0]ReadingmyObject["interests"][0]ReadingObject with nested objectThis object contains multiple comma-delimited key/value pairs and a nested object. To access an object within an object, property names or 'keys' can be chain
© 2010 - 2020 网站综合信息查询 同IP网站查询 相关类似网站查询 网站备案查询网站地图 最新查询 最近更新 优秀网站 热门网站 全部网站 同IP查询 备案查询
2026-01-19 06:39, Process in 0.0091 second.