위키 사본미러

이곳은 pascal.chat 위키의 미러입니다. 편집, 기록, 로그인은 그곳에서 할 수 있습니다.

JSON/ko

한국어 · English · Polski · Suomi · Русский · 中文(中国) · 日本語

소개

JSON (JavaScript Object Notation) is a form of data representation that provides a standardised data exchange format using simple text. As the name suggests, it is based on a subset of the JavaScript programming language; however, it is completely language-agnostic. Besides being easy for humans to read and write, it is also easy for machines to parse and generate.

Compared to XML, it is more human-readable.

JSON Object

A JSON Object is nothing more than a collection of comma-separated name/value pairs (often called members) enclosed in curly brackets:

javascript
{"name1":value1, "name2":value2 ...}

To make it easier for humans to read and visualize, the name/value pairs are often listed vertically:

javascript
{
    "name1": value1,
    "name2": value2
}

문자열의 이름은 더블쿼터 안에 있어야 지원합니다, 다음사항을 참고하세요:

JSON objects can always be nested arbitrarily to create even more complex objects:

javascript
{"user":
    {   "userid": 1900,
        "username": "jsmith",
        "password": "secret",
        "groups": [ "admins", "users", "maintainers"]
    }
}

JSON 포맷

There are a few rules and guidelines that define the JSON syntax (see RFC 4627):

구현

JSON implementation is not very strict, and a lot of leeway is granted to the client application and/or parser to enforce the guidelines. As usual when writing code:

There are two main implementations of JSON:

일반적인 JSON 상세 구문

This implementation adheres strictly to the RFC 4627 guidelines above and does not allow deviation from the specification.

자바스크립트 구문

This implementation follows the implementation of the Javascript programming language and as such allows for a few deviations from the official specification. For example:

  1. allows un-quoted keys eg {name: "John Doe" }
  2. allows single quotes for keys and/or string values; and a liberal mix of single and double quotes eg {'name': "John Doe", "language":'Pascal'}
  3. allows trailing comma after the last member of an array and/or object eg {"keywords":["if","begin","for",], "IDEs":["Lazarus","fpIDE","MSEide"],}

같이보기


From the Free Pascal wiki, page "JSON/ko", as it stood on 2017-02-24 after a change by FTurtle, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

1판, 마지막 편집: WikiArchive .