JSON

JSON
Phần mở rộng tên file.json
Kiểu phương tiệnapplication/json
Kiểu định dạngtrao đổi thông tin
Được mở rộng từJavaScript
Tiêu chuẩnRFC 4627
Websitehttp://json.org/

JavaScript Object Notation (thường được viết tắt là JSON) là một kiểu dữ liệu mở trong JavaScript. Kiểu dữ liệu này bao gồm chủ yếu là văn bản, có thể đọc được theo dạng cặp "thuộc tính - giá trị". Về cấu trúc, nó mô tả một vật thể bằng cách bọc những vật thể con trong vật thể lớn hơn trong dấu ngoặc nhọn ({ }). JSON là một kiểu dữ liệu trung gian, chủ yếu được dùng để vận chuyển thông tin giữa các thành phần của một chương trình.[1][2]

Ví dụ

{ 
    "name":"Product",
    "properties":
    { 
        "id":
        { 
            "type":"number",
            "description":"Product identifier",
            "required":true 
        }, 
        "name": 
        { 
            "description":"Name of the product", 
            "type":"string", 
            "required":true 
            
        },
        "price": 
        { 
            "type":"number",
            "minimum":0, 
            "required":true 
            
        }, 
        "tags": 
        { 
            "type":"array", 
            "items": 
            { 
                "type":"string" 
            } 
        } 
    } 
}

Tham khảo

  1. ^ "A Modern Reintroduction To AJAX". Truy cập ngày 12 tháng 4 năm 2017.
  2. ^ "Standard ECMA-404". www.ecma-international.org.

Liên kết ngoài

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.