{"id":75359,"date":"2024-07-11T20:10:48","date_gmt":"2024-07-11T13:10:48","guid":{"rendered":"https:\/\/itviec.com\/blog\/?p=75359"},"modified":"2024-07-11T20:10:48","modified_gmt":"2024-07-11T13:10:48","slug":"json-la-gi","status":"publish","type":"post","link":"https:\/\/itviec.com\/blog\/json-la-gi\/","title":{"rendered":"JSON l\u00e0 g\u00ec? C\u00e1c lo\u1ea1i d\u1eef li\u1ec7u JSON l\u00e0 g\u00ec v\u00e0 \u00e1p d\u1ee5ng th\u1ebf n\u00e0o?"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">N\u1ed9i dung b\u00e0i vi\u1ebft<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/itviec.com\/blog\/json-la-gi\/#JSON_la_gi\" >JSON l\u00e0 g\u00ec?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/itviec.com\/blog\/json-la-gi\/#Cau_truc_cu_phap_JSON\" >C\u1ea5u tr\u00fac c\u00fa ph\u00e1p JSON\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/itviec.com\/blog\/json-la-gi\/#Diem_manh_va_han_che_cua_JSON_la_gi\" >\u0110i\u1ec3m m\u1ea1nh v\u00e0 h\u1ea1n ch\u1ebf c\u1ee7a JSON l\u00e0 g\u00ec?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/itviec.com\/blog\/json-la-gi\/#Ung_dung_cua_JSON_la_gi\" >\u1ee8ng d\u1ee5ng c\u1ee7a JSON l\u00e0 g\u00ec<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/itviec.com\/blog\/json-la-gi\/#Cac_loai_du_lieu_cua_JSON\" >C\u00e1c lo\u1ea1i d\u1eef li\u1ec7u c\u1ee7a JSON<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/itviec.com\/blog\/json-la-gi\/#Mot_so_vi_du_co_ban_cua_JSON\" >M\u1ed9t s\u1ed1 v\u00ed d\u1ee5 c\u01a1 b\u1ea3n c\u1ee7a JSON<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/itviec.com\/blog\/json-la-gi\/#Cach_su_dung_JSON_trong_API_va_Javascript\" >C\u00e1ch s\u1eed d\u1ee5ng JSON trong API v\u00e0 Javascript<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/itviec.com\/blog\/json-la-gi\/#Cac_cau_hoi_thuong_gap_ve_JSON_la_gi\" >C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 JSON l\u00e0 g\u00ec<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/itviec.com\/blog\/json-la-gi\/#Tong_ket_ve_JSON_la_gi\" >T\u1ed5ng k\u1ebft v\u1ec1 JSON l\u00e0 g\u00ec<\/a><\/li><\/ul><\/nav><\/div>\n<p><b><i>Trong th\u1eddi \u0111\u1ea1i c\u00f4ng ngh\u1ec7 hi\u1ec7n \u0111\u1ea1i, h\u1ea7u h\u1ebft c\u00e1c \u1ee9ng d\u1ee5ng ph\u1ea7n m\u1ec1m, d\u00f9 l\u00e0 website, laptop hay thi\u1ebft b\u1ecb di \u0111\u1ed9ng \u0111\u1ec1u d\u1ef1a v\u00e0o \u0111\u1ecbnh d\u1ea1ng trao \u0111\u1ed5i ph\u1ed5 bi\u1ebfn l\u00e0 JSON. \u0110\u1ecbnh d\u1ea1ng n\u00e0y gi\u00fap x\u00e1c \u0111\u1ecbnh m\u1ed9t b\u1ed9 quy t\u1eafc \u0111\u1ec3 bi\u1ec3u di\u1ec5n v\u00e0 truy\u1ec1n d\u1eef li\u1ec7u qua c\u00e1c \u1ee9ng d\u1ee5ng, m\u00e1y ch\u1ee7 ho\u1eb7c h\u1ec7 \u0111i\u1ec1u h\u00e0nh. V\u1eady JSON l\u00e0 g\u00ec? V\u00e0 \u1ee9ng d\u1ee5ng c\u1ee7a \u0111\u1ecbnh d\u1ea1ng d\u1eef li\u1ec7u n\u00e0y nh\u01b0 th\u1ebf n\u00e0o?<\/i><\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u0110\u1ecdc b\u00e0i vi\u1ebft sau \u0111\u00e2y \u0111\u1ec3 \u0111\u01b0\u1ee3c gi\u1ea3i \u0111\u00e1p chi ti\u1ebft v\u1ec1:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u1ed5ng quan v\u1ec1 JSON l\u00e0 g\u00ec, bao g\u1ed3m kh\u00e1i qu\u00e1t v\u1ec1 \u0111\u1ecbnh ngh\u0129a, c\u1ea5u tr\u00fac c\u0169ng nh\u01b0 \u1ee9ng d\u1ee5ng.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u00e1ch s\u1eed d\u1ee5ng c\u00f9ng m\u1ed9t s\u1ed1 v\u00ed d\u1ee5 c\u01a1 b\u1ea3n v\u1ec1 JSON trong Javascript.\u00a0<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"JSON_la_gi\"><\/span>JSON l\u00e0 g\u00ec?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">JSON l\u00e0 g\u00ec? JSON l\u00e0 vi\u1ebft t\u1eaft c\u1ee7a Javascript Object Notation, l\u00e0 m\u1ed9t ki\u1ec3u \u0111\u1ecbnh d\u1ea1ng d\u1eef li\u1ec7u c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ed9c l\u1eadp v\u1edbi Javascript v\u00e0 h\u1ea7u h\u1ebft ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh hi\u1ec7n nay \u0111\u1ec1u c\u00f3 th\u1ec3 \u0111\u1ecdc (ph\u00e2n t\u00edch c\u00fa ph\u00e1p) c\u0169ng nh\u01b0 t\u1ea1o m\u00e3 JSON.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">JSON th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong trao \u0111\u1ed5i d\u1eef li\u1ec7u \u0111i\u1ec7n t\u1eed, ch\u1eb3ng h\u1ea1n nh\u01b0 truy\u1ec1n d\u1eef li\u1ec7u trong c\u00e1c \u1ee9ng d\u1ee5ng web. C\u00e1c trang web n\u00e0y hi\u1ec3n th\u1ecb th\u00f4ng tin \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef tr\u01b0\u1edbc trong m\u00e1y ch\u1ee7 v\u00e0 t\u01b0\u01a1ng t\u00e1c v\u1edbi m\u00e1y ch\u1ee7 b\u1eb1ng c\u00e1c \u0111\u1ecbnh d\u1ea1ng d\u1eef li\u1ec7u JSON.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 hi\u1ec3u r\u00f5 v\u1ec1 JSON, b\u1ea1n s\u1ebd c\u1ea7n c\u00f3 n\u1ec1n t\u1ea3ng c\u01a1 b\u1ea3n v\u1ec1 <\/span><a href=\"https:\/\/itviec.com\/blog\/html-la-gi\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">HTML<\/span><\/a><span style=\"font-weight: 400;\">, <\/span><a href=\"https:\/\/itviec.com\/blog\/css-la-gi\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">CSS<\/span><\/a><span style=\"font-weight: 400;\"> c\u0169ng nh\u01b0 l\u00e0m quen v\u1edbi Javascript. M\u1eb7c d\u00f9 JSON \u0111\u01b0\u1ee3c ph\u00e1t tri\u1ec3n d\u1ef1a tr\u00ean c\u1ea5u tr\u00fac Javascript Object Syntax nh\u01b0ng n\u00f3 v\u1eabn l\u00e0 \u0111\u1ecbnh d\u1ea1ng d\u1eef li\u1ec7u \u0111\u1ed9c l\u1eadp.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Cau_truc_cu_phap_JSON\"><\/span><b> C\u1ea5u tr\u00fac c\u00fa ph\u00e1p JSON\u00a0<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">C\u00fa ph\u00e1p JSON c\u01a1 b\u1ea3n:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">JSON.staticMethod()<\/span><span style=\"font-weight: 400;\">;<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">\u0110\u1ecbnh d\u1ea1ng c\u1ea5u tr\u00fac c\u1ee7a JSON g\u1ea7n gi\u1ed1ng v\u1edbi Javascript Object Literal, tuy nhi\u00ean JSON kh\u00f4ng ph\u1ee5 thu\u1ed9c v\u00e0o Javascript. S\u1ef1 gi\u1ed1ng nhau n\u00e0y gi\u00fap c\u00e1c ch\u01b0\u01a1ng tr\u00ecnh vi\u1ebft b\u1eb1ng Javascript d\u1ec5 d\u00e0ng \u0111\u01b0\u1ee3c chuy\u1ec3n \u0111\u1ed5i sang \u0111\u1ecbnh d\u1ea1ng d\u1eef li\u1ec7u JSON.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">JSON l\u00e0 t\u1eadp h\u1ee3p c\u00e1c c\u1eb7p <\/span><span style=\"font-weight: 400;\">key &#8211; value<\/span><span style=\"font-weight: 400;\"> trong \u0111\u00f3 <\/span><span style=\"font-weight: 400;\">key <\/span><span style=\"font-weight: 400;\">l\u00e0 lo\u1ea1i chu\u1ed7i v\u00e0 <\/span><span style=\"font-weight: 400;\">value <\/span><span style=\"font-weight: 400;\">c\u00f3 th\u1ec3 thu\u1ed9c b\u1ea5t k\u1ef3 lo\u1ea1i d\u1eef li\u1ec7u n\u00e0o nh\u01b0 number, string, boolean, array, object ho\u1eb7c null. Trong JSON, d\u1eef li\u1ec7u c\u1eb7p <\/span><span style=\"font-weight: 400;\">key-value<\/span><span style=\"font-weight: 400;\"> \u0111\u01b0\u1ee3c ph\u00e2n t\u00e1ch b\u1eb1ng d\u1ea5u ph\u1ea9y. D\u1ea5u ngo\u1eb7c nh\u1ecdn ch\u1ee9a \u0111\u1ed1i t\u01b0\u1ee3ng v\u00e0 \u0111\u01b0\u1ee3c t\u00e1ch ra kh\u1ecfi key b\u1eb1ng d\u1ea5u hai ch\u1ea5m. D\u1ea5u ngo\u1eb7c vu\u00f4ng gi\u1eef array v\u00e0 d\u1ea5u ph\u1ea9y ng\u0103n c\u00e1ch array kh\u1ecfi value.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">D\u1eef li\u1ec7u h\u1ee3p l\u1ec7 c\u1ee7a JSON c\u00f3 th\u1ec3 \u1edf hai \u0111\u1ecbnh d\u1ea1ng kh\u00e1c nhau:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u1eadp h\u1ee3p c\u00e1c c\u1eb7p kh\u00f3a <\/span><span style=\"font-weight: 400;\">key-value<\/span><span style=\"font-weight: 400;\"> bao quanh b\u1edfi m\u1ed9t c\u1eb7p d\u1ea5u ngo\u1eb7c nh\u1ecdn.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u1eadp h\u1ee3p danh s\u00e1ch c\u00f3 th\u1ee9 t\u1ef1 c\u00e1c c\u1eb7p <\/span><span style=\"font-weight: 400;\">key-value<\/span><span style=\"font-weight: 400;\"> \u0111\u01b0\u1ee3c ph\u00e2n t\u00e1ch b\u1eb1ng d\u1ea7u ph\u1ea9y (,) ho\u1eb7c c\u1eb7p d\u1ea5u ngo\u1eb7c vu\u00f4ng [&#8230;]<\/span><\/li>\n<\/ul>\n<pre><span style=\"font-weight: 400;\">{<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \"name\": <\/span><span style=\"font-weight: 400;\">\"ITviec Blog\"<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \"city\": <\/span><span style=\"font-weight: 400;\">\"Ho Chi Minh City, Vietnam\"<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-75363 aligncenter\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-1-vippro.jpg\" alt=\"c\u00fa ph\u00e1p json - itviec blog\" width=\"919\" height=\"252\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-1-vippro.jpg 919w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-1-vippro-300x82.jpg 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-1-vippro-700x192.jpg 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-1-vippro-200x55.jpg 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-1-vippro-100x27.jpg 100w\" sizes=\"auto, (max-width: 919px) 100vw, 919px\" \/><\/p>\n<p style=\"text-align: center;\"><i><span style=\"font-weight: 400;\">T\u1eadp h\u1ee3p c\u1eb7p gi\u00e1 tr\u1ecb bao quanh b\u1edfi d\u1ea5u ngo\u1eb7c nh\u1ecdn. (Ngu\u1ed3n: turing.com)<\/span><\/i><\/p>\n<pre><span style=\"font-weight: 400;\">[<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \"name\": <\/span><span style=\"font-weight: 400;\">\"ITviec Blog\"<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \"city\": <\/span><span style=\"font-weight: 400;\">\"Ho Chi Minh City, Vietnam\"<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 }<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \"name\": <\/span><span style=\"font-weight: 400;\">\"ITviec Blog\"<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \"city\": <\/span><span style=\"font-weight: 400;\">\"Ho Chi Minh City, Vietnam\"<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 }<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \"name\": <\/span><span style=\"font-weight: 400;\">\"ITviec Blog\"<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \"city\": <\/span><span style=\"font-weight: 400;\">\"Ho Chi Minh City, Vietnam\"<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 }<\/span>\r\n<span style=\"font-weight: 400;\">]<\/span><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-75364 aligncenter\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-2-vippro.jpg\" alt=\"c\u00fa ph\u00e1p json - itviec blog\" width=\"1047\" height=\"269\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-2-vippro.jpg 1047w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-2-vippro-300x77.jpg 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-2-vippro-700x180.jpg 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-2-vippro-200x51.jpg 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-2-vippro-100x26.jpg 100w\" sizes=\"auto, (max-width: 1047px) 100vw, 1047px\" \/><\/p>\n<p style=\"text-align: center;\"><i><span style=\"font-weight: 400;\">T\u1eadp h\u1ee3p danh s\u00e1ch bao b\u1ecdc b\u1edfi d\u1ea7u ngo\u1eb7c vu\u00f4ng. (Ngu\u1ed3n: turing.com)<\/span><\/i><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Diem_manh_va_han_che_cua_JSON_la_gi\"><\/span><b>\u0110i\u1ec3m m\u1ea1nh v\u00e0 h\u1ea1n ch\u1ebf c\u1ee7a JSON l\u00e0 g\u00ec?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">JSON s\u1edf h\u1eefu m\u1ed9t s\u1ed1 l\u1ee3i th\u1ebf nh\u01b0:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>\u0110\u01a1n gi\u1ea3n v\u00e0 d\u1ec5 \u0111\u1ecdc:<\/b><span style=\"font-weight: 400;\"> JSON bao g\u1ed3m c\u00e1c c\u1eb7p <\/span><span style=\"font-weight: 400;\">key &#8211; value<\/span><span style=\"font-weight: 400;\">, kh\u00f4ng y\u00eau c\u1ea7u b\u1ea5t k\u1ef3 th\u1ebb, thu\u1ed9c t\u00ednh hay l\u01b0\u1ee3c \u0111\u1ed3 \u0111\u1eb7c bi\u1ec7t n\u00e0o. JSON c\u0169ng c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng chuy\u1ec3n \u0111\u1ed5i sang Object Javascript gi\u00fap thu\u1eadn ti\u1ec7n cho c\u00e1c nh\u00e0 ph\u00e1t tri\u1ec3n web s\u1eed d\u1ee5ng Javascript l\u00e0m ng\u00f4n ng\u1eef ch\u00ednh cho \u1ee9ng d\u1ee5ng web.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>T\u01b0\u01a1ng th\u00edch v\u00e0 t\u01b0\u01a1ng t\u00e1c t\u1ed1t:<\/b><span style=\"font-weight: 400;\"> JSON \u0111\u01b0\u1ee3c h\u1ed7 tr\u1ee3 r\u1ed9ng r\u00e3i b\u1edfi h\u1ea7u h\u1ebft c\u00e1c tr\u00ecnh duy\u1ec7t, m\u00e1y ch\u1ee7 web v\u00e0 API hi\u1ec7n \u0111\u1ea1i gi\u00fap d\u1ec5 d\u00e0ng trao \u0111\u1ed5i d\u1eef li\u1ec7u tr\u00ean c\u00e1c h\u1ec7 th\u1ed1ng kh\u00e1c nhau. JSON c\u0169ng c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng v\u1edbi nhi\u1ec1u th\u01b0 vi\u1ec7n v\u00e0 c\u00f4ng c\u1ee5 kh\u00e1c nhau cung c\u1ea5p ch\u1ee9c n\u0103ng ph\u00e2n t\u00edch c\u00fa ph\u00e1p v\u00e0 chuy\u1ec3n \u0111\u1ed5i d\u1eef li\u1ec7u.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Hi\u1ec7u su\u1ea5t v\u00e0 hi\u1ec7u qu\u1ea3: <\/b><span style=\"font-weight: 400;\">JSON nhanh v\u00e0 nh\u1eb9 h\u01a1n XML v\u00ec c\u00f3 k\u00edch th\u01b0\u1edbc nh\u1ecf c\u0169ng nh\u01b0 \u0111\u01a1n gi\u1ea3n h\u01a1n. JSON kh\u00f4ng c\u00f3 b\u1ea5t k\u1ef3 th\u00f4ng tin d\u01b0 th\u1eeba ho\u1eb7c kh\u00f4ng c\u1ea7n thi\u1ebft n\u00e0o. \u0110\u1ed3ng th\u1eddi, JSON c\u00f3 c\u00fa ph\u00e1p nh\u1ecf g\u1ecdn v\u00e0 nh\u1ea5t qu\u00e1n h\u01a1n. B\u00ean c\u1ea1nh \u0111\u00f3, JSON c\u0169ng c\u00f3 th\u1ec3 c\u1ea3i thi\u1ec7n t\u1ed1c \u0111\u1ed9 v\u00e0 kh\u1ea3 n\u0103ng ph\u1ea3n h\u1ed3i c\u1ee7a \u1ee9ng d\u1ee5ng web.\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">B\u00ean c\u1ea1nh \u0111\u00f3, c\u0169ng c\u00f3 m\u1ed9t s\u1ed1 \u0111i\u1ec3m c\u00f2n h\u1ea1n ch\u1ebf c\u1ee7a \u0111\u1ecbnh d\u1ea1ng JSON nh\u01b0 sau:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Kh\u00f4ng x\u1eed l\u00fd l\u1ed7i:<\/b><span style=\"font-weight: 400;\"> JSON kh\u00f4ng c\u00f3 c\u01a1 ch\u1ebf x\u1eed l\u00fd l\u1ed7i \u0111\u1ed1i v\u1edbi JSON calls. X\u1eed l\u00fd l\u1ed7i c\u0169ng ph\u1ee5 thu\u1ed9c v\u00e0o vi\u1ec7c ch\u00e8n t\u1eadp l\u1ec7nh \u0111\u1ed9ng, n\u1ebfu kh\u00f4ng c\u00f3 t\u00ednh n\u0103ng n\u00e0y, m\u00e3 c\u00f3 th\u1ec3 b\u1ecb l\u1ed7i.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>\u0110\u1ed9 b\u1ea3o m\u1eadt<\/b><span style=\"font-weight: 400;\">: JSON s\u1ebd d\u1ec5 b\u1ecb truy\u1ec1n th\u00f4ng tin ra ngo\u00e0i n\u1ebfu s\u1eed d\u1ee5ng v\u1edbi c\u00e1c tr\u00ecnh duy\u1ec7t ho\u1eb7c d\u1ecbch v\u1ee5 kh\u00f4ng \u0111\u00e1ng tin c\u1eady. Do \u0111\u00f3, n\u00f3 l\u00e0m cho c\u00e1c d\u1ecbch v\u1ee5 web d\u1ec5 b\u1ecb t\u1ea5n c\u00f4ng b\u1edfi c\u00e1c lo\u1ea1i t\u1ea5n c\u00f4ng m\u1ea1ng kh\u00e1c nhau.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Kh\u00f4ng c\u00f3 lo\u1ea1i ng\u00e0y: <\/b><span style=\"font-weight: 400;\">Kh\u1ea3 n\u0103ng hi\u1ec3n th\u1ecb s\u1ebd b\u1ecb l\u1ed7i trong c\u00e1ch hi\u1ec3n th\u1ecb chu\u1ed7i ng\u00e0y th\u00e1ng.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>T\u00ednh m\u1ea1nh m\u1ebd: <\/b><span style=\"font-weight: 400;\">JSON kh\u00f4ng m\u1ea1nh b\u1eb1ng c\u1ea5u tr\u00fac d\u1eef li\u1ec7u XML. H\u1ea1n ch\u1ebf n\u00e0y do s\u1ef1 thi\u1ebfu s\u1eb5n c\u00f3 c\u1ee7a c\u00e1c l\u01b0\u1ee3c \u0111\u1ed3 \u0111\u01b0\u1ee3c ti\u00eau chu\u1ea9n h\u00f3a.\u00a0<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Ung_dung_cua_JSON_la_gi\"><\/span><b> \u1ee8ng d\u1ee5ng c\u1ee7a JSON l\u00e0 g\u00ec<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">JSON \u0111\u00e3 tr\u1edf n\u00ean r\u1ea5t ph\u1ed5 bi\u1ebfn hi\u1ec7n nay b\u1edfi t\u00ednh d\u1ec5 s\u1eed d\u1ee5ng v\u00e0 \u0111\u01a1n gi\u1ea3n. \u0110\u1ecbnh d\u1ea1ng d\u1eef li\u1ec7u JSON \u0111\u00e3 thay th\u1ebf XML, v\u1ed1n \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng kh\u00e1 ph\u1ed5 bi\u1ebfn nh\u01b0ng n\u1eb7ng v\u00e0 kh\u00f3 h\u1ecdc. M\u1eb7t kh\u00e1c, JSON khi\u1ebfn vi\u1ec7c truy\u1ec1n d\u1eef li\u1ec7u tr\u1edf n\u00ean d\u1ec5 d\u00e0ng h\u01a1n, c\u00fa ph\u00e1p d\u1ec5 h\u1ecdc v\u00e0 t\u01b0\u01a1ng th\u00edch v\u1edbi ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh kh\u00e1c.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">M\u1ed9t s\u1ed1 \u1ee9ng d\u1ee5ng n\u1ed5i b\u1eadt c\u1ee7a JSON bao g\u1ed3m:\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\u0110\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 vi\u1ebft m\u00e3 tr\u00ean \u1ee9ng d\u1ee5ng ho\u1eb7c trang web d\u1ef1a theo Javascript. Ti\u1ec7n \u00edch m\u1edf r\u1ed9ng tr\u00ecnh duy\u1ec7t nh\u01b0 m\u1ed9t ph\u1ea7n t\u00ednh n\u0103ng c\u1ee7a ch\u00fang.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\u0110\u01b0\u1ee3c s\u1eed d\u1ee5ng v\u1edbi nhi\u1ec1u ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh hi\u1ec7n \u0111\u1ea1i nh\u01b0 Python, <\/span><a href=\"https:\/\/itviec.com\/blog\/ruby-on-rails\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Ruby<\/span><\/a><span style=\"font-weight: 400;\">, <\/span><a href=\"https:\/\/itviec.com\/blog\/java-la-gi\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Java<\/span><\/a><span style=\"font-weight: 400;\">,&#8230;\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u1ea7n thi\u1ebft trong vi\u1ec7c chuy\u1ec3n d\u1eef li\u1ec7u c\u00f3 c\u1ea5u tr\u00fac qua k\u1ebft n\u1ed1i m\u1ea1ng.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Th\u01b0\u1eddng \u0111\u01b0\u1ee3c d\u00f9ng \u0111\u1ec3 l\u1ea5y d\u1eef li\u1ec7u t\u1eeb m\u00e1y ch\u1ee7 b\u1eb1ng c\u00e1c \u1ee9ng d\u1ee5ng web.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng \u0111\u1ec3 xu\u1ea5t b\u1ea3n d\u1eef li\u1ec7u c\u00f4ng khai b\u1edfi c\u00e1c d\u1ecbch v\u1ee5 web.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng \u0111\u1ec3 di chuy\u1ec3n t\u1eeb c\u01a1 s\u1edf d\u1eef li\u1ec7u n\u00e0y sang c\u01a1 s\u1edf d\u1eef li\u1ec7u kh\u00e1c.\u00a0<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Cac_loai_du_lieu_cua_JSON\"><\/span><b> C\u00e1c lo\u1ea1i d\u1eef li\u1ec7u c\u1ee7a JSON<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">JSON l\u00e0 \u0111\u1ecbnh d\u1ea1ng d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng r\u1ed9ng r\u00e3i cho c\u00e1c trao \u0111\u1ed5i d\u1eef li\u1ec7u tr\u00ean World Wide Web, \u0111\u1ecbnh d\u1ea1ng d\u1eef li\u1ec7u n\u00e0y bao g\u1ed3m b\u1ea3y lo\u1ea1i d\u1eef li\u1ec7u kh\u00e1c nhau nh\u01b0 Number, String, Boolean, Array, Object, Whitespace v\u00e0 Null. C\u00e1c gi\u00e1 tr\u1ecb c\u1ee5 th\u1ec3 nh\u01b0 sau:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-75365 aligncenter\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-3-vippro.jpg\" alt=\"d\u1eef li\u1ec7u json - itviec blog\" width=\"698\" height=\"637\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-3-vippro.jpg 698w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-3-vippro-300x274.jpg 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-3-vippro-640x584.jpg 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-3-vippro-200x183.jpg 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-3-vippro-100x91.jpg 100w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/json-3-vippro-493x450.jpg 493w\" sizes=\"auto, (max-width: 698px) 100vw, 698px\" \/><\/p>\n<p style=\"text-align: center;\"><i><span style=\"font-weight: 400;\">C\u00e1c gi\u00e1 tr\u1ecb d\u1eef li\u1ec7u c\u1ee7a JSON. (Ngu\u1ed3n: turing.com)<\/span><\/i><\/p>\n<h3><b>D\u1eef li\u1ec7u s\u1ed1 (Number)<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">D\u1eef li\u1ec7u s\u1ed1 trong JSON l\u00e0 lo\u1ea1i d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 bi\u1ec3u th\u1ecb c\u00e1c s\u1ed1 li\u1ec7u trong h\u1ec7 th\u1ed1ng t\u00ednh to\u00e1n c\u01a1 b\u1ea3n. M\u1ed9t s\u1ed1 \u0111\u1ea1i di\u1ec7n cho m\u1ed9t s\u1ed1 nguy\u00ean d\u01b0\u01a1ng, s\u1ed1 nguy\u00ean \u00e2m, d\u1ea5u c\u1ed9ng \u0111\u01a1n gi\u1ea3n hay k\u00fd hi\u1ec7u h\u00e0m m\u0169.\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">S\u1ed1 nguy\u00ean: Bao g\u1ed3m ch\u1eef 0 l\u00e0 c\u00e1c s\u1ed1 d\u01b0\u01a1ng ho\u1eb7c \u00e2m t\u1eeb 1 \u0111\u1ebfn 9.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ph\u00e2n s\u1ed1: Bi\u1ec3u th\u1ecb c\u00e1c s\u1ed1 c\u00f3 d\u1ea5u th\u1eadp ph\u00e2n nh\u01b0 5.5, 9.5<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">S\u1ed1 m\u0169: M\u1ed9t s\u1ed1 trong JSON c\u00f3 th\u1ec3 c\u00f3 s\u1ed1 m\u0169 l\u00e0 10 v\u00e0 ph\u1ea3i c\u00f3 ti\u1ec1n t\u1ed1 d\u1ea5u m\u0169 l\u00e0 e+, e-, E+, E-<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Tuy nhi\u00ean, s\u1ed1 kh\u00f4ng th\u1ec3 \u0111\u01b0\u1ee3c bi\u1ec3u di\u1ec5n d\u01b0\u1edbi d\u1ea1ng chu\u1ed7i (string) \u1edf c\u1ea5u tr\u00fac JSON b\u1edfi ch\u1ec9 s\u1eed d\u1ee5ng s\u1ed1 th\u1eadp ph\u00e2n l\u00e0m cho h\u1ec7 th\u1eadp l\u1ee5c ph\u00e2n c\u1ee7a JSON tr\u1edf n\u00ean l\u1ed7i th\u1eddi.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 v\u1ec1 c\u00fa ph\u00e1p c\u1ee7a d\u1eef li\u1ec7u s\u1ed1 trong JSON l\u00e0:<\/span><\/p>\n<pre>{\"length\": 150.35}<\/pre>\n<h3><b>Chu\u1ed7i (String)<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Chu\u1ed7i (String) l\u00e0 m\u1ed9t chu\u1ed7i g\u1ed3m c\u00e1c k\u00fd t\u1ef1 Unicode \u0111\u01b0\u1ee3c vi\u1ebft theo quy t\u1eafc c\u1ee5 th\u1ec3. C\u00e1c chu\u1ed7i trong JSON lu\u00f4n \u0111\u01b0\u1ee3c vi\u1ebft b\u1eb1ng d\u1ea5u ngo\u1eb7c k\u00e9p (\u201c\u201d), t\u01b0\u01a1ng t\u1ef1 v\u1edbi ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh C. N\u1ebfu c\u00e1c chu\u1ed7i \u0111\u01b0\u1ee3c \u0111\u1eb7t trong d\u1ea5u ngo\u1eb7c \u0111\u01a1n (\u2018\u2019) s\u1ebd tr\u1edf n\u00ean kh\u00f4ng h\u1ee3p l\u1ec7. B\u1ea1n c\u0169ng c\u00f3 th\u1ec3 d\u00f9ng c\u00e1c k\u00fd t\u1ef1 nh\u01b0 g\u1ea1ch ch\u00e9o ti\u1ebfn (\\\/), g\u1ea1ch ch\u00e9o ng\u01b0\u1ee3c (\\\\), d\u1ea5u l\u00f9i (\\b), d\u00f2ng m\u1edbi (\\n), d\u1ea5u xu\u1ed1ng d\u00f2ng (\\r),&#8230;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 v\u1ec1 lo\u1ea1i d\u1eef li\u1ec7u chu\u1ed7i c\u1ee7a JSON nh\u01b0 sau:<\/span><\/p>\n<pre>{\"name\":\"Jade\"} or <b><\/b>{\"city\":\"Accra\\\/Ghana\"}<\/pre>\n<h3><b>Boolean<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Boolean l\u00e0 m\u1ed9t ki\u1ec3u d\u1eef li\u1ec7u c\u1ee7a JSON c\u00f3 th\u1ec3 t\u1ed3n t\u1ea1i d\u01b0\u1edbi d\u1ea1ng m\u1ed9t trong hai t\u00f9y ch\u1ecdn, gi\u00e1 tr\u1ecb c\u1ee7a Boolean c\u00f3 th\u1ec3 l\u00e0 \u0111\u00fang (true) ho\u1eb7c sai (false). Khi s\u1eed d\u1ee5ng d\u1eef li\u1ec7u Boolean, d\u1ea5u ngo\u1eb7c k\u00e9p s\u1ebd kh\u00f4ng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 v\u1ec1 ki\u1ec3u d\u1eef li\u1ec7u Boolean nh\u01b0 sau:<\/span><\/p>\n<pre>{\"transparency\": false} and {\"green\": true}<b><\/b><\/pre>\n<h3><b>M\u1ea3ng (Array)<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">M\u1ea3ng l\u00e0 m\u1ed9t t\u1eadp h\u1ee3p c\u00e1c gi\u00e1 tr\u1ecb \u0111\u01b0\u1ee3c \u0111\u1eb7t trong d\u1ea5u ngo\u1eb7c vu\u00f4ng [] v\u00e0 ph\u00e2n c\u00e1ch b\u1eb1ng d\u1ea5u ph\u1ea9y (,). M\u1ea3ng bao g\u1ed3m c\u00e1c gi\u00e1 tr\u1ecb li\u00ean quan, n\u00ean s\u1eed d\u1ee5ng khi <\/span><span style=\"font-weight: 400;\">key<\/span><span style=\"font-weight: 400;\"> \u0111\u01b0\u1ee3c t\u1ea1o t\u1eeb c\u00e1c s\u1ed1 nguy\u00ean. B\u1ea1n c\u00f3 th\u1ec3 b\u1eaft \u0111\u1ea7u l\u1eadp ch\u1ec9 m\u1ee5c trong m\u1ea3ng t\u1eeb 0 ho\u1eb7c 1.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 v\u1ec1 lo\u1ea1i d\u1eef li\u1ec7u m\u1ea3ng trong JSON nh\u01b0 sau:<\/span><\/p>\n<pre>{\"colors\": [\"red\",\"orange\",\"yellow\",\"blue\"]}<\/pre>\n<p><span style=\"font-weight: 400;\">Ho\u1eb7c:<\/span><\/p>\n<pre>{\"serial numbers\": [\"302\", \"303\" \"305\" \"306\" \"307\"]}<b><\/b><\/pre>\n<h3><b>\u0110\u1ed1i t\u01b0\u1ee3ng (Object)<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">\u0110\u1ed1i t\u01b0\u1ee3ng trong JSON \u0111\u01b0\u1ee3c t\u1ea1o th\u00e0nh t\u1eeb c\u00e1c t\u1eadp h\u1ee3p d\u1eef li\u1ec7u kh\u00f4ng c\u00f3 th\u1ee9 t\u1ef1 ho\u1eb7c kh\u00f4ng c\u00f3 c\u1ea5u tr\u00fac, \u0111\u01b0\u1ee3c bi\u1ec3u th\u1ecb d\u01b0\u1edbi d\u1ea1ng c\u1eb7p <\/span><span style=\"font-weight: 400;\">key &#8211; value<\/span><span style=\"font-weight: 400;\"> v\u00e0 \u0111\u01b0\u1ee3c \u0111\u1eb7t \u1edf gi\u1eefa m\u1ed9t c\u1eb7p d\u1ea5u ngo\u1eb7c nh\u1ecdn {}. M\u1ed9t \u0111\u1ed1i t\u01b0\u1ee3ng c\u00f3 th\u1ec3 ch\u1ee9a b\u1ea5t k\u1ef3 c\u1eb7p <\/span><span style=\"font-weight: 400;\">key &#8211; value<\/span><span style=\"font-weight: 400;\"> v\u1edbi gi\u00e1 tr\u1ecb t\u1eeb 0 tr\u1edf l\u00ean. <\/span><span style=\"font-weight: 400;\">Key<\/span><span style=\"font-weight: 400;\"> ph\u1ea3i l\u00e0 ki\u1ec3u d\u1eef li\u1ec7u chu\u1ed7i v\u00e0 l\u00e0 duy nh\u1ea5t. Khi c\u00f3 nhi\u1ec1u h\u01a1n m\u1ed9t c\u1eb7p <\/span><span style=\"font-weight: 400;\">key &#8211; value<\/span><span style=\"font-weight: 400;\">, t\u00ean theo sau b\u1edfi d\u1ea5u hai ch\u1ea5m v\u00e0 \u0111\u01b0\u1ee3c ph\u00e2n c\u00e1ch b\u1eb1ng d\u1ea5u ph\u1ea9y.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 v\u1ec1 Object trong JSON nh\u01b0 sau:<\/span><\/p>\n<pre>{\r\n\"participant\": {\"name\": \"rose\",\"age\": \"17\",\"status\":\"disqualified\"}\r\n}<b><\/b><\/pre>\n<h3><b>Kho\u1ea3ng tr\u1eafng (Whitespace)<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Kho\u1ea3ng tr\u1eafng ch\u1ec9 \u0111\u01a1n gi\u1ea3n l\u00e0 kho\u1ea3ng tr\u1eafng th\u00f4ng th\u01b0\u1eddng \u0111\u01b0\u1ee3c th\u00eam v\u00e0o \u0111o\u1ea1n m\u00e3 \u0111\u1ec3 gi\u00fap d\u1ec5 \u0111\u1ecdc h\u01a1n. Kho\u1ea3ng tr\u1eafng th\u1ef1c t\u1ebf kh\u00f4ng \u1ea3nh h\u01b0\u1edfng \u0111\u1ebfn to\u00e0n b\u1ed9 m\u00e3 ho\u1eb7c \u0111\u1ecbnh d\u1ea1ng d\u1eef li\u1ec7u JSON. N\u00f3 c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c l\u00e0m gi\u1ea3m \u0111\u1ebfn m\u1ee9c t\u1ed1i thi\u1ec3u m\u00e0 kh\u00f4ng l\u00e0m h\u1ecfng c\u1ea5u tr\u00fac.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 v\u1ec1 kho\u1ea3ng tr\u1eafng c\u1ee5 th\u1ec3 nh\u01b0 sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">{\"name\": <\/span><span style=\"font-weight: 400;\">\" ITviec Blog \"<\/span><span style=\"font-weight: 400;\">}<\/span> <span style=\"font-weight: 400;\">(kho\u1ea3ng tr\u1eafng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng)<\/span><\/pre>\n<pre><b>{\"name\": <\/b><b>\"ITviec Blog\"<\/b><b>}<\/b> <span style=\"font-weight: 400;\">(kho\u1ea3ng tr\u1eafng kh\u00f4ng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng)<\/span><b><\/b><\/pre>\n<h3><b>Null\u00a0<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">V\u1ec1 m\u1eb7t k\u1ef9 thu\u1eadt, null kh\u00f4ng ph\u1ea3i l\u00e0 lo\u1ea1i gi\u00e1 tr\u1ecb d\u1eef li\u1ec7u. Tuy nhi\u00ean, n\u00f3 l\u1ea1i \u0111\u01b0\u1ee3c ph\u00e2n lo\u1ea1i l\u00e0 m\u1ed9t gi\u00e1 tr\u1ecb \u0111\u1eb7c bi\u1ec7t trong JSON. Null m\u00f4 t\u1ea3 s\u1ef1 \u201cv\u1eafng m\u1eb7t\u201d c\u1ee7a gi\u00e1 tr\u1ecb, t\u1ee9c l\u00e0 kh\u00f4ng c\u00f3 gi\u00e1 tr\u1ecb n\u00e0o \u0111\u01b0\u1ee3c g\u00e1n cho <\/span><span style=\"font-weight: 400;\">key<\/span><span style=\"font-weight: 400;\">. Khi s\u1eed d\u1ee5ng ti\u00eau \u0111\u1ec1 null th\u00ec kh\u00f4ng c\u1ea7n s\u1eed d\u1ee5ng d\u1ea5u ngo\u1eb7c k\u00e9p. V\u00ed d\u1ee5 c\u1ee5 th\u1ec3 nh\u01b0 sau:<\/span><\/p>\n<pre>{\r\n\"friendly\": true\r\n\"receptive\": true\r\n\"intelligent\": null\r\n}<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Mot_so_vi_du_co_ban_cua_JSON\"><\/span><b> M\u1ed9t s\u1ed1 v\u00ed d\u1ee5 c\u01a1 b\u1ea3n c\u1ee7a JSON<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>B\u00e0i t\u1eadp v\u00ed d\u1ee5 JSON trong kinh doanh<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">JSON th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong t\u00ecnh hu\u1ed1ng kinh doanh kh\u00e1c nhau \u0111\u1ec3 x\u00e1c th\u1ef1c d\u1eef li\u1ec7u \u0111\u1ea7u v\u00e0o c\u0169ng nh\u01b0 x\u00e1c minh r\u1eb1ng c\u00e1c th\u00f4ng b\u00e1o mang d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c x\u00e2y d\u1ef1ng ch\u00ednh x\u00e1c. Ch\u00fang th\u01b0\u1eddng l\u00e0 \u0111o\u1ea1n code ph\u1ee9c t\u1ea1p \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong API ho\u1eb7c th\u1ecfa thu\u1eadn trao \u0111\u1ed5i d\u1eef li\u1ec7u.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Ch\u1eb3ng h\u1ea1n v\u1edbi b\u00e0i t\u1eadp sau, c\u00f4ng ty c\u1ed1 g\u1eafng x\u00e1c nh\u1eadn r\u1eb1ng ch\u1ec9 nh\u1eefng \u0111\u01a1n h\u00e0ng \u0111\u01b0\u1ee3c t\u1ea1o ch\u00ednh x\u00e1c m\u1edbi \u0111\u01b0\u1ee3c nh\u1eadp d\u1eef li\u1ec7u v\u00e0o h\u1ec7 th\u1ed1ng.<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">{<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \"type\": <\/span><span style=\"font-weight: 400;\">\"object\"<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \"properties\": {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \"name\": {\"type\": <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">},<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \"sku\": {\"type\": <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">},<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \"price\": {\"type\": <\/span><span style=\"font-weight: 400;\">\"number\"<\/span><span style=\"font-weight: 400;\">, \"minimum\": <\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">},<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \"shipTo\": {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"type\": <\/span><span style=\"font-weight: 400;\">\"object\"<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"properties\": {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"name\": {\"type\": <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">},<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"address\": {\"type\": <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">},<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"city\": {\"type\": <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">},<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"state\": {\"type\": <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">},<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"zip\": {\"type\": <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">}<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 },<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \"billTo\": {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"type\": <\/span><span style=\"font-weight: 400;\">\"object\"<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"properties\": {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"name\": {\"type\": <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">},<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"address\": {\"type\": <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">},<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"city\": {\"type\": <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">},<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"state\": {\"type\": <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">},<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"zip\": {\"type\": <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">}<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 }<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 }<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">\u1ede v\u00ed d\u1ee5 tr\u00ean, c\u00f3 th\u1ec3 th\u1ea5y:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Kh\u00f3a <\/span><b>&#8220;type&#8221;<\/b><span style=\"font-weight: 400;\"> \u0111\u01b0\u1ee3c \u0111\u1eb7t th\u00e0nh <\/span><b>&#8220;object&#8221;<\/b><span style=\"font-weight: 400;\">, cho bi\u1ebft l\u01b0\u1ee3c \u0111\u1ed3 n\u00e0y m\u00f4 t\u1ea3 m\u1ed9t c\u1ea5u tr\u00fac d\u1eef li\u1ec7u ph\u1ee9c t\u1ea1p.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Kh\u00f3a <\/span><b>&#8220;properties&#8221;<\/b><span style=\"font-weight: 400;\"> x\u00e1c \u0111\u1ecbnh c\u00e1c thu\u1ed9c t\u00ednh b\u00ean trong \u0111\u1ed1i t\u01b0\u1ee3ng n\u00e0y v\u00e0 ki\u1ec3u d\u1eef li\u1ec7u c\u1ee7a ch\u00fang.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>&#8220;name&#8221;<\/b><span style=\"font-weight: 400;\">: Thu\u1ed9c t\u00ednh n\u00e0y c\u00f3 th\u1ec3 \u0111\u1ea1i di\u1ec7n cho t\u00ean v\u00e0 ph\u1ea3i l\u00e0 chu\u1ed7i.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>&#8220;sku&#8221;<\/b><span style=\"font-weight: 400;\">: C\u00f3 th\u1ec3 l\u00e0 m\u1ed9t \u0111\u01a1n v\u1ecb l\u01b0u kho (m\u00e3 \u0111\u1ecbnh danh cho s\u1ea3n ph\u1ea9m) v\u00e0 ph\u1ea3i l\u00e0 chu\u1ed7i.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>&#8220;price&#8221;<\/b><span style=\"font-weight: 400;\">: Thu\u1ed9c t\u00ednh n\u00e0y \u0111\u1ea1i di\u1ec7n cho gi\u00e1 v\u00e0 ph\u1ea3i l\u00e0 s\u1ed1. N\u00f3 c\u0169ng c\u00f3 r\u00e0ng bu\u1ed9c gi\u00e1 tr\u1ecb t\u1ed1i thi\u1ec3u l\u00e0 0, \u0111\u1ea3m b\u1ea3o gi\u00e1 kh\u00f4ng \u00e2m.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>&#8220;shipTo&#8221;<\/b><span style=\"font-weight: 400;\"> v\u00e0 <\/span><b>&#8220;billTo&#8221;<\/b><span style=\"font-weight: 400;\">: Nh\u1eefng thu\u1ed9c t\u00ednh n\u00e0y \u0111\u1ec1u l\u00e0 c\u00e1c \u0111\u1ed1i t\u01b0\u1ee3ng ri\u00eang bi\u1ec7t, cho bi\u1ebft c\u00e1c c\u1ea5u tr\u00fac l\u1ed3ng nhau. Ch\u00fang c\u00f3 th\u1ec3 \u0111\u1ea1i di\u1ec7n cho \u0111\u1ecba ch\u1ec9 giao h\u00e0ng v\u00e0 thanh to\u00e1n.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">M\u1ed7i c\u1ea5u tr\u00fac l\u1ed3ng nhau \u0111\u1ec1u c\u00f3 c\u00f9ng c\u1ea5u tr\u00fac<\/span><b> \u201ctype\u201d<\/b><span style=\"font-weight: 400;\"> v\u00e0 <\/span><b>\u201cproperties\u201d<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\u0110\u1ed3ng th\u1eddi, <\/span><b>\u201cname\u201d, \u201caddress\u201d, \u201ccity\u201d, \u201cstate\u201d, \u201czip\u201d<\/b><span style=\"font-weight: 400;\"> th\u1ec3 hi\u1ec7n cho m\u1ed9t c\u1ea5u tr\u00fac \u0111\u1ecba ch\u1ec9 \u0111\u1ea7y \u0111\u1ee7.\u00a0<\/span><\/li>\n<\/ul>\n<h3><b>B\u00e0i t\u1eadp nh\u00f3m d\u1eef li\u1ec7u trong JSON<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Nh\u00f3m d\u1eef li\u1ec7u trong JSON \u0111\u01b0\u1ee3c th\u1ef1c hi\u1ec7n b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng c\u00e1c c\u1ea5u tr\u00fac l\u1ed3ng nhau. Ch\u1eb3ng h\u1ea1n nh\u01b0 b\u00e0i t\u1eadp v\u00ed d\u1ee5 v\u1ec1 thu\u1ed9c t\u00ednh c\u1ee7a chi\u1ebfc b\u00e1nh donut b\u00ean d\u01b0\u1edbi.<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">{<\/span>\r\n<span style=\"font-weight: 400;\">\"id\": <\/span><span style=\"font-weight: 400;\">\"0009\"<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\"type\": <\/span><span style=\"font-weight: 400;\">\"donut\"<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\"name\": <\/span><span style=\"font-weight: 400;\">\"Cake\"<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\"image\": {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \"url\": <\/span><span style=\"font-weight: 400;\">\"images\/0009.jpg\"<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \"width\": <\/span><span style=\"font-weight: 400;\">300<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \"height\": <\/span><span style=\"font-weight: 400;\">300<\/span>\r\n<span style=\"font-weight: 400;\">},<\/span>\r\n<span style=\"font-weight: 400;\">\"thumbnail\": {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \"url\": <\/span><span style=\"font-weight: 400;\">\"images\/thumbnails\/0009.jpg\"<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \"width\": <\/span><span style=\"font-weight: 400;\">42<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \"height\": <\/span><span style=\"font-weight: 400;\">42<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">\u1ede v\u00ed d\u1ee5 tr\u00ean, \u0111o\u1ea1n code s\u1eed d\u1ee5ng c\u1eb7p gi\u00e1 tr\u1ecb key &#8211; value \u0111\u1ec3 l\u01b0u tr\u1eef th\u00f4ng tin, m\u1ed7i key t\u01b0\u01a1ng \u1ee9ng t\u1eebng thu\u1ed9c t\u00ednh c\u1ee7a chi\u1ebfc b\u00e1nh v\u00e0 c\u00e1c gi\u00e1 tr\u1ecb c\u00f3 th\u1ec3 l\u00e0 chu\u1ed7i, s\u1ed1 ho\u1eb7c \u0111\u1ed1i t\u01b0\u1ee3ng JSON.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>id: <\/b><span style=\"font-weight: 400;\">M\u00e3 \u0111\u1ecbnh danh duy nh\u1ea5t cho chi\u1ebfc b\u00e1nh donut (ki\u1ec3u chu\u1ed7i, gi\u00e1 tr\u1ecb &#8220;0009&#8221;).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>type:<\/b><span style=\"font-weight: 400;\"> Lo\u1ea1i b\u00e1nh (ki\u1ec3u chu\u1ed7i, gi\u00e1 tr\u1ecb &#8220;donut&#8221;).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>name: <\/b><span style=\"font-weight: 400;\">T\u00ean b\u00e1nh (ki\u1ec3u chu\u1ed7i, gi\u00e1 tr\u1ecb &#8220;Cake&#8221;).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>image: <\/b><span style=\"font-weight: 400;\">Th\u00f4ng tin v\u1ec1 \u1ea3nh \u0111\u1ea1i di\u1ec7n c\u1ee7a b\u00e1nh.<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>url: <\/b><span style=\"font-weight: 400;\">\u0110\u01b0\u1eddng d\u1eabn \u0111\u1ebfn \u1ea3nh (ki\u1ec3u chu\u1ed7i, gi\u00e1 tr\u1ecb &#8220;images\/0009.jpg&#8221;).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>width: <\/b><span style=\"font-weight: 400;\">Chi\u1ec1u r\u1ed9ng \u1ea3nh (ki\u1ec3u s\u1ed1, gi\u00e1 tr\u1ecb 300).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>height:<\/b><span style=\"font-weight: 400;\"> Chi\u1ec1u cao \u1ea3nh (ki\u1ec3u s\u1ed1, gi\u00e1 tr\u1ecb 300).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>thumbnail:<\/b><span style=\"font-weight: 400;\"> Th\u00f4ng tin v\u1ec1 \u1ea3nh thu nh\u1ecf c\u1ee7a b\u00e1nh.<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>url:<\/b><span style=\"font-weight: 400;\"> \u0110\u01b0\u1eddng d\u1eabn \u0111\u1ebfn \u1ea3nh thu nh\u1ecf (ki\u1ec3u chu\u1ed7i, gi\u00e1 tr\u1ecb &#8220;images\/thumbnails\/0009.jpg&#8221;).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>width:<\/b><span style=\"font-weight: 400;\"> Chi\u1ec1u r\u1ed9ng \u1ea3nh thu nh\u1ecf (ki\u1ec3u s\u1ed1, gi\u00e1 tr\u1ecb 42).<\/span><\/li>\n<li><b>height:<\/b><span style=\"font-weight: 400;\">Chi\u1ec1u cao \u1ea3nh thu nh\u1ecf (ki\u1ec3u s\u1ed1, gi\u00e1 tr\u1ecb 42).<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Cach_su_dung_JSON_trong_API_va_Javascript\"><\/span><b>C\u00e1ch s\u1eed d\u1ee5ng JSON trong API v\u00e0 Javascript<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>APIs Call<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">M\u1ed9t trong nh\u1eefng c\u00e1ch s\u1eed d\u1ee5ng JSON ph\u1ed5 bi\u1ebfn l\u00e0 s\u1eed d\u1ee5ng API c\u1ea3 trong y\u00eau c\u1ea7u v\u00e0 ph\u1ea3n h\u1ed3i. N\u00f3 nh\u1ecf g\u1ecdn h\u01a1n nhi\u1ec1u so v\u1edbi c\u00e1c ti\u00eau chu\u1ea9n kh\u00e1c v\u00e0 cho ph\u00e9p s\u1eed d\u1ee5ng trong c\u00e1c tr\u00ecnh duy\u1ec7t web v\u00ec Javascript c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng ph\u00e2n t\u00edch c\u00e1c chu\u1ed7i JSON, ch\u1ec9 c\u1ea7n y\u00eau c\u1ea7u JSON.parse() \u0111\u1ec3 b\u1eaft \u0111\u1ea7u s\u1eed d\u1ee5ng.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">JSON.parse(string) l\u1ea5y m\u1ed9t chu\u1ed7i JSON h\u1ee3p l\u1ec7 v\u00e0 tr\u1ea3 v\u1ec1 m\u1ed9t \u0111\u1ed1i t\u01b0\u1ee3ng Javascript. V\u00ed d\u1ee5 c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c g\u1ecdi trong ph\u1ea7n n\u1ed9i dung c\u1ee7a ph\u1ea3n h\u1ed3i API cung c\u1ea5p cho b\u1ea1n m\u1ed9t \u0111\u1ed1i t\u01b0\u1ee3ng c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng \u0111\u01b0\u1ee3c. Ngh\u1ecbch \u0111\u1ea3o c\u1ee7a h\u00e0m n\u00e0y l\u00e0 JSON.stringify(object) l\u1ea5y m\u1ed9t \u0111\u1ed1i t\u01b0\u1ee3ng Javascript v\u00e0 tr\u1ea3 v\u1ec1 m\u1ed9t chu\u1ed7i JSON.\u00a0<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">{<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \"foo\": {<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \"bar\": <\/span><span style=\"font-weight: 400;\">\"data\"<\/span><span style=\"font-weight: 400;\">,<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 \u00a0 \"baz\": <\/span><span style=\"font-weight: 400;\">\"data\"<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0 }<\/span>\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<blockquote><p>Xem th\u00eam: <a href=\"https:\/\/itviec.com\/blog\/api-la-gi\/\" target=\"_blank\" rel=\"noopener\"><b>API l\u00e0 g\u00ec? 4 \u0111\u1eb7c \u0111i\u1ec3m n\u1ed5i b\u1eadt c\u1ee7a API<\/b><\/a><\/p><\/blockquote>\n<h3><b>Javascript<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Trong m\u1ed9t s\u1ed1 tr\u01b0\u1eddng h\u1ee3p, b\u1ea1n mu\u1ed1n t\u1ea3i JSON t\u1eeb m\u1ed9t t\u1ec7p, ch\u1eb3ng h\u1ea1n nh\u01b0 t\u1ec7p c\u1ea5u h\u00ecnh ho\u1eb7c d\u1eef li\u1ec7u m\u00f4 ph\u1ecfng. B\u1ea1n c\u00f3 th\u1ec3 xu\u1ea5t Object Javascript gi\u1ed1ng nh\u01b0 JSON b\u1ea1n \u0111ang mu\u1ed1n t\u1ea3i t\u1eeb t\u1ec7p Javascript:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">export<\/span> <span style=\"font-weight: 400;\">const<\/span><span style=\"font-weight: 400;\"> data = {<\/span><span style=\"font-weight: 400;\">\"foo\"<\/span><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">\"bar\"<\/span><span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">L\u00fac n\u00e0y, \u0111\u1ed1i t\u01b0\u1ee3ng s\u1ebd \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef trong d\u1eef li\u1ec7u v\u00e0 c\u00f3 th\u1ec3 truy c\u1eadp \u0111\u01b0\u1ee3c trong to\u00e0n b\u1ed9 \u1ee9ng d\u1ee5ng c\u1ee7a b\u1ea1n b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng c\u00e1c c\u00e2u l\u1ec7nh ho\u1eb7c nh\u1eadp y\u00eau c\u1ea7u. Tuy nhi\u00ean, b\u1ea1n n\u00ean l\u01b0u \u00fd r\u1eb1ng thao t\u00e1c s\u1ebd nh\u1eadp m\u1ed9t b\u1ea3n sao d\u1eef li\u1ec7u, do \u0111\u00f3 vi\u1ec7c s\u1eeda \u0111\u1ed5i \u0111\u1ed1i t\u01b0\u1ee3ng s\u1ebd kh\u00f4ng ghi d\u1eef li\u1ec7u tr\u1edf l\u1ea1i v\u00e0o t\u1ec7p, ho\u1eb7c cho ph\u00e9p s\u1eed d\u1ee5ng d\u1eef li\u1ec7u \u0111\u00e3 s\u1eeda \u0111\u1ed5i trong c\u00e1c t\u1ec7p kh\u00e1c.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Cac_cau_hoi_thuong_gap_ve_JSON_la_gi\"><\/span><b>C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 JSON l\u00e0 g\u00ec<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>Khi n\u00e0o n\u00ean s\u1eed d\u1ee5ng JSON?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Khi b\u1ea1n mu\u1ed1n l\u01b0u tr\u1eef d\u1eef li\u1ec7u \u0111\u01a1n thu\u1ea7n d\u01b0\u1edbi d\u1ea1ng metadata, chu\u1ed7i JSON s\u1ebd l\u01b0u v\u00e0o database sau \u0111\u00f3 khi c\u1ea7n d\u1eef li\u1ec7u, b\u1ea1n ch\u1ec9 c\u1ea7n gi\u1ea3i m\u00e3 ch\u00fang. Ch\u1eb3ng h\u1ea1n, v\u1edbi <\/span><a href=\"https:\/\/itviec.com\/blog\/php-la-gi\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">PHP<\/span><\/a><span style=\"font-weight: 400;\"> s\u1ebd cung c\u1ea5p c\u00e1c h\u00e0m li\u00ean quan \u0111\u1ebfn JSON \u0111\u1ec3 m\u00e3 h\u00f3a.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Ngo\u00e0i ra, trong Javascript khi d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c \u0111\u1ecbnh d\u1ea1ng trong format JSON xu\u1ea5t hi\u1ec7n trong c\u00e1c y\u00eau c\u1ea7u <\/span><a href=\"https:\/\/itviec.com\/blog\/ajax-la-gi\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">AJAX<\/span><\/a><span style=\"font-weight: 400;\">, c\u0169ng l\u00e0 m\u1ed9t tr\u01b0\u1eddng h\u1ee3p kh\u00e1 ph\u1ed5 bi\u1ebfn \u0111\u1ec3 ng\u01b0\u1eddi d\u00f9ng s\u1eed d\u1ee5ng JSON.<\/span><\/p>\n<h3><b>JSON v\u00e0 Object Javascript c\u00f3 gi\u1ed1ng nhau kh\u00f4ng?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">\u0110\u1ecbnh d\u1ea1ng d\u1eef li\u1ec7u JSON \u0111\u01b0\u1ee3c l\u1ea5y t\u1eeb c\u1ea5u tr\u00fac \u0111\u1ed1i t\u01b0\u1ee3ng (object) Javascript, tuy nhi\u00ean \u0111\u1ecbnh d\u1ea1ng JSON c\u0169ng c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c truy c\u1eadp v\u00e0 t\u1ea1o b\u1edfi c\u00e1c ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh kh\u00e1c. Do \u0111\u00f3, JSON v\u00e0 Object Javascript kh\u00f4ng gi\u1ed1ng nhau.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">M\u1ed9t s\u1ed1 \u0111\u1eb7c \u0111i\u1ec3m v\u1ec1 Object Javascript v\u00e0 JSON nh\u01b0 sau:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>JSON<\/b><\/td>\n<td><b>Object Javascript<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">C\u1eb7p <\/span><span style=\"font-weight: 400;\">key &#8211; value<\/span><span style=\"font-weight: 400;\"> ph\u1ea3i n\u1eb1m trong d\u1ea5u ngo\u1eb7c k\u00e9p<\/span><\/td>\n<td><span style=\"font-weight: 400;\">C\u1eb7p <\/span><span style=\"font-weight: 400;\">key &#8211; value<\/span><span style=\"font-weight: 400;\"> c\u00f3 th\u1ec3 kh\u00f4ng c\u00f3 d\u1ea5u ngo\u1eb7c k\u00e9p<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Kh\u00f4ng th\u1ec3 ch\u1ee9a c\u00e1c h\u00e0m<\/span><\/td>\n<td><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 ch\u1ee9a c\u00e1c h\u00e0m<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c t\u1ea1o v\u00e0 s\u1eed d\u1ee5ng b\u1edfi c\u00e1c ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh kh\u00e1c<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Ch\u1ec9 c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong Javascript<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><b>S\u1eeda l\u1ed7i trong m\u00e3 JSON nh\u01b0 th\u1ebf n\u00e0o?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Khi vi\u1ebft m\u00e3 JSON, ch\u1eafc h\u1eb3n b\u1ea1n s\u1ebd g\u1eb7p ph\u1ea3i nh\u1eefng l\u1ed7i v\u1ec1 ph\u00e2n t\u00edch c\u00fa ph\u00e1p d\u1eef li\u1ec7u JSON th\u00e0nh Object Javascript. Khi g\u1eb7p l\u1ed7i, b\u1ea1n h\u00e3y ki\u1ec3m tra l\u1ea1i th\u1eadt k\u1ef9 c\u1ea5u tr\u00fac m\u00e3 c\u0169ng nh\u01b0 \u0111\u1ecbnh d\u1ea1ng d\u1eef li\u1ec7u JSON. B\u1ea1n c\u0169ng c\u00f3 th\u1ec3 x\u00e1c \u0111\u1ecbnh \u0111\u1ecbnh d\u1ea1ng c\u1ee7a d\u1eef li\u1ec7u JSON b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng c\u00e1c ph\u1ea7n m\u1ec1m ki\u1ec3m tra nh\u01b0 <\/span><a href=\"https:\/\/jsonlint.com\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">JSON Linter<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Tong_ket_ve_JSON_la_gi\"><\/span><b>T\u1ed5ng k\u1ebft v\u1ec1 JSON l\u00e0 g\u00ec<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><b>JSON<\/b><span style=\"font-weight: 400;\"> l\u00e0 m\u1ed9t \u0111\u1ecbnh d\u1ea1ng d\u1eef li\u1ec7u \u0111\u01a1n gi\u1ea3n, nh\u1eb9 v\u00e0 d\u1ec5 d\u00e0ng s\u1eed d\u1ee5ng trong qu\u00e1 tr\u00ecnh l\u1eadp tr\u00ecnh web. V\u1edbi kh\u1ea3 n\u0103ng t\u01b0\u01a1ng th\u00edch v\u1edbi \u0111a s\u1ed1 c\u00e1c ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh hi\u1ec7n nay, JSON \u0111\u00e3 tr\u1edf th\u00e0nh ph\u1ea7n m\u1ec1m h\u1eefu \u00edch \u0111\u1ec3 truy\u1ec1n t\u1ea3i v\u00e0 l\u01b0u tr\u1eef d\u1eef li\u1ec7u gi\u1eefa m\u00e1y ch\u1ee7 v\u1edbi tr\u00ecnh duy\u1ec7t.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Hy v\u1ecdng qua b\u00e0i vi\u1ebft, b\u1ea1n s\u1ebd c\u00f3 g\u00f3c nh\u00ecn t\u1ed5ng quan h\u01a1n v\u1ec1 \u0111\u1ecbnh d\u1ea1ng d\u1eef li\u1ec7u <\/span><b>JSON l\u00e0 g\u00ec<\/b><span style=\"font-weight: 400;\"> c\u0169ng nh\u01b0 nh\u1eefng ti\u1ec7n \u00edch c\u1ee7a ch\u00fang. N\u1ebfu b\u1ea1n \u0111ang c\u00f3 \u0111\u1ecbnh h\u01b0\u1edbng tr\u1edf th\u00e0nh Web Developer ho\u1eb7c ph\u00e1t tri\u1ec3n m\u1ed9t \u1ee9ng d\u1ee5ng web, c\u00f3 th\u1ec3 c\u00e2n nh\u1eafc s\u1eed d\u1ee5ng JSON \u0111\u1ec3 t\u1ed1i \u01b0u c\u0169ng nh\u01b0 \u0111\u01a1n gi\u1ea3n h\u00f3a qu\u00e1 tr\u00ecnh x\u1eed l\u00fd d\u1eef li\u1ec7u nh\u00e9!<\/span><\/p>\n<blockquote><p>Xem th\u00eam: <a href=\"https:\/\/itviec.com\/blog\/javascript-la-gi\/\" target=\"_blank\" rel=\"noopener\"><b>Javascript l\u00e0 g\u00ec? H\u1ecdc Javascript c\u01a1 b\u1ea3n v\u1edbi l\u1ed9 tr\u00ecnh d\u1ec5 hi\u1ec3u nh\u1ea5t<\/b><\/a><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Trong th\u1eddi \u0111\u1ea1i c\u00f4ng ngh\u1ec7 hi\u1ec7n \u0111\u1ea1i, h\u1ea7u h\u1ebft c\u00e1c \u1ee9ng d\u1ee5ng ph\u1ea7n m\u1ec1m, d\u00f9 l\u00e0 website, laptop hay thi\u1ebft b\u1ecb di \u0111\u1ed9ng \u0111\u1ec1u d\u1ef1a v\u00e0o \u0111\u1ecbnh d\u1ea1ng trao \u0111\u1ed5i ph\u1ed5 bi\u1ebfn l\u00e0 JSON. \u0110\u1ecbnh d\u1ea1ng n\u00e0y gi\u00fap x\u00e1c \u0111\u1ecbnh m\u1ed9t b\u1ed9 quy t\u1eafc \u0111\u1ec3 bi\u1ec3u di\u1ec5n v\u00e0 truy\u1ec1n d\u1eef li\u1ec7u qua c\u00e1c \u1ee9ng d\u1ee5ng, [&hellip;]<\/p>\n","protected":false},"author":207,"featured_media":75362,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_gspb_post_css":"","footnotes":""},"categories":[109],"tags":[],"class_list":["post-75359","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chuyen-mon-it"],"blocksy_meta":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.8 (Yoast SEO v27.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>JSON l\u00e0 g\u00ec? C\u00e1c lo\u1ea1i d\u1eef li\u1ec7u JSON l\u00e0 g\u00ec v\u00e0 \u00e1p d\u1ee5ng th\u1ebf n\u00e0o? - ITviec Blog<\/title>\n<meta name=\"description\" content=\"JSON th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 truy\u1ec1n d\u1eef li\u1ec7u gi\u1eefa \u1ee9ng d\u1ee5ng web v\u00e0 m\u00e1y ch\u1ee7. V\u1eady th\u00ec JSON l\u00e0 g\u00ec? T\u00ecm hi\u1ec3u chi ti\u1ebft v\u1ec1 JSON ngay t\u1ea1i b\u00e0i vi\u1ebft n\u00e0y!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itviec.com\/blog\/json-la-gi\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JSON l\u00e0 g\u00ec? C\u00e1c lo\u1ea1i d\u1eef li\u1ec7u JSON l\u00e0 g\u00ec v\u00e0 \u00e1p d\u1ee5ng th\u1ebf n\u00e0o?\" \/>\n<meta property=\"og:description\" content=\"Trong th\u1eddi \u0111\u1ea1i c\u00f4ng ngh\u1ec7 hi\u1ec7n \u0111\u1ea1i, h\u1ea7u h\u1ebft c\u00e1c \u1ee9ng d\u1ee5ng ph\u1ea7n m\u1ec1m, d\u00f9 l\u00e0 website, laptop hay thi\u1ebft b\u1ecb di \u0111\u1ed9ng \u0111\u1ec1u d\u1ef1a v\u00e0o \u0111\u1ecbnh d\u1ea1ng trao \u0111\u1ed5i ph\u1ed5 bi\u1ebfn l\u00e0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itviec.com\/blog\/json-la-gi\/\" \/>\n<meta property=\"og:site_name\" content=\"ITviec Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ITviec\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-11T13:10:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/Json-la-gi-thumbnail-vippro.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1500\" \/>\n\t<meta property=\"og:image:height\" content=\"790\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Uyen Ngo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ITviec\" \/>\n<meta name=\"twitter:site\" content=\"@ITviec\" \/>\n<meta name=\"twitter:label1\" content=\"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi\" \/>\n\t<meta name=\"twitter:data1\" content=\"Uyen Ngo\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data2\" content=\"17 ph\u00fat\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"JSON l\u00e0 g\u00ec? C\u00e1c lo\u1ea1i d\u1eef li\u1ec7u JSON l\u00e0 g\u00ec v\u00e0 \u00e1p d\u1ee5ng th\u1ebf n\u00e0o? - ITviec Blog","description":"JSON th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 truy\u1ec1n d\u1eef li\u1ec7u gi\u1eefa \u1ee9ng d\u1ee5ng web v\u00e0 m\u00e1y ch\u1ee7. V\u1eady th\u00ec JSON l\u00e0 g\u00ec? T\u00ecm hi\u1ec3u chi ti\u1ebft v\u1ec1 JSON ngay t\u1ea1i b\u00e0i vi\u1ebft n\u00e0y!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itviec.com\/blog\/json-la-gi\/","og_locale":"vi_VN","og_type":"article","og_title":"JSON l\u00e0 g\u00ec? C\u00e1c lo\u1ea1i d\u1eef li\u1ec7u JSON l\u00e0 g\u00ec v\u00e0 \u00e1p d\u1ee5ng th\u1ebf n\u00e0o?","og_description":"Trong th\u1eddi \u0111\u1ea1i c\u00f4ng ngh\u1ec7 hi\u1ec7n \u0111\u1ea1i, h\u1ea7u h\u1ebft c\u00e1c \u1ee9ng d\u1ee5ng ph\u1ea7n m\u1ec1m, d\u00f9 l\u00e0 website, laptop hay thi\u1ebft b\u1ecb di \u0111\u1ed9ng \u0111\u1ec1u d\u1ef1a v\u00e0o \u0111\u1ecbnh d\u1ea1ng trao \u0111\u1ed5i ph\u1ed5 bi\u1ebfn l\u00e0","og_url":"https:\/\/itviec.com\/blog\/json-la-gi\/","og_site_name":"ITviec Blog","article_publisher":"https:\/\/www.facebook.com\/ITviec","article_published_time":"2024-07-11T13:10:48+00:00","og_image":[{"width":1500,"height":790,"url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/Json-la-gi-thumbnail-vippro.jpg","type":"image\/jpeg"}],"author":"Uyen Ngo","twitter_card":"summary_large_image","twitter_creator":"@ITviec","twitter_site":"@ITviec","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"Uyen Ngo","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"17 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itviec.com\/blog\/json-la-gi\/#article","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/json-la-gi\/"},"author":{"name":"Uyen Ngo","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/f4cd1226846e0258c664e170d3e52d20"},"headline":"JSON l\u00e0 g\u00ec? C\u00e1c lo\u1ea1i d\u1eef li\u1ec7u JSON l\u00e0 g\u00ec v\u00e0 \u00e1p d\u1ee5ng th\u1ebf n\u00e0o?","datePublished":"2024-07-11T13:10:48+00:00","mainEntityOfPage":{"@id":"https:\/\/itviec.com\/blog\/json-la-gi\/"},"wordCount":4198,"publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"image":{"@id":"https:\/\/itviec.com\/blog\/json-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/Json-la-gi-thumbnail-vippro.jpg","articleSection":["Chuy\u00ean m\u00f4n IT"],"inLanguage":"vi"},{"@type":"WebPage","@id":"https:\/\/itviec.com\/blog\/json-la-gi\/","url":"https:\/\/itviec.com\/blog\/json-la-gi\/","name":"JSON l\u00e0 g\u00ec? C\u00e1c lo\u1ea1i d\u1eef li\u1ec7u JSON l\u00e0 g\u00ec v\u00e0 \u00e1p d\u1ee5ng th\u1ebf n\u00e0o? - ITviec Blog","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itviec.com\/blog\/json-la-gi\/#primaryimage"},"image":{"@id":"https:\/\/itviec.com\/blog\/json-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/Json-la-gi-thumbnail-vippro.jpg","datePublished":"2024-07-11T13:10:48+00:00","description":"JSON th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 truy\u1ec1n d\u1eef li\u1ec7u gi\u1eefa \u1ee9ng d\u1ee5ng web v\u00e0 m\u00e1y ch\u1ee7. V\u1eady th\u00ec JSON l\u00e0 g\u00ec? T\u00ecm hi\u1ec3u chi ti\u1ebft v\u1ec1 JSON ngay t\u1ea1i b\u00e0i vi\u1ebft n\u00e0y!","breadcrumb":{"@id":"https:\/\/itviec.com\/blog\/json-la-gi\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itviec.com\/blog\/json-la-gi\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/json-la-gi\/#primaryimage","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/Json-la-gi-thumbnail-vippro.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/07\/Json-la-gi-thumbnail-vippro.jpg","width":1500,"height":790,"caption":"json l\u00e0 g\u00ec - itviec blog"},{"@type":"BreadcrumbList","@id":"https:\/\/itviec.com\/blog\/json-la-gi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Chuy\u00ean m\u00f4n IT","item":"https:\/\/itviec.com\/blog\/chuyen-mon-it\/"},{"@type":"ListItem","position":2,"name":"JSON l\u00e0 g\u00ec? C\u00e1c lo\u1ea1i d\u1eef li\u1ec7u JSON l\u00e0 g\u00ec v\u00e0 \u00e1p d\u1ee5ng th\u1ebf n\u00e0o?"}]},{"@type":"WebSite","@id":"https:\/\/itviec.com\/blog\/#website","url":"https:\/\/itviec.com\/blog\/","name":"ITviec Blog","description":"IT Jobs &amp; People in Vietnam","publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itviec.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"vi"},{"@type":"Organization","@id":"https:\/\/itviec.com\/blog\/#organization","name":"ITviec","url":"https:\/\/itviec.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","width":1800,"height":1800,"caption":"ITviec"},"image":{"@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ITviec","https:\/\/x.com\/ITviec","https:\/\/www.linkedin.com\/company\/itviec","https:\/\/www.youtube.com\/channel\/UCYthAQ3bcGr57M_ag5gHDvQ"]},{"@type":"Person","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/f4cd1226846e0258c664e170d3e52d20","name":"Uyen Ngo","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/ngo-thieu-my-uyen-author-e1709880420317-100x100.jpg","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/ngo-thieu-my-uyen-author-e1709880420317-100x100.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/ngo-thieu-my-uyen-author-e1709880420317-100x100.jpg","caption":"Uyen Ngo"},"url":"https:\/\/itviec.com\/blog\/author\/uyen-ngo\/"}]}},"_links":{"self":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/75359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/users\/207"}],"replies":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/comments?post=75359"}],"version-history":[{"count":0,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/75359\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media\/75362"}],"wp:attachment":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media?parent=75359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/categories?post=75359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/tags?post=75359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}