<!DOCTYPE html>
    <html lang="vi" xmlns="http://www.w3.org/1999/xhtml" prefix="og: http://ogp.me/ns#">
    <head>
<title>File JSON là gì?</title>
<meta name="description" content="File JSON là gì? - Savefile - Tin Tức - https&#x3A;&#x002F;&#x002F;www.nguoicodonvn2008.info&#x002F;vi&#x002F;news&#x002F;savefile&#x002F;kien-thuc-may-tinh&#x002F;file-json-la-gi-7027.html">
<meta name="author" content=".: Nguoicodonvn2008.info - Cõi lòng người cô đơn :.">
<meta name="copyright" content=".: Nguoicodonvn2008.info - Cõi lòng người cô đơn :. [admin@nguoicodonvn2008.info]">
<meta name="robots" content="index, archive, follow, noodp">
<meta name="googlebot" content="index,archive,follow,noodp">
<meta name="msnbot" content="all,index,follow">
<meta name="generator" content="NukeViet v4.5">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta property="og:title" content="File JSON là gì?">
<meta property="og:type" content="website">
<meta property="og:description" content="Savefile - Tin Tức - https&#x3A;&#x002F;&#x002F;www.nguoicodonvn2008.info&#x002F;vi&#x002F;news&#x002F;savefile&#x002F;kien-thuc-may-tinh&#x002F;file-json-la-gi-7027.html">
<meta property="og:site_name" content=".&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;.">
<meta property="og:url" content="https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/file-json-la-gi-7027.html">
<link rel="shortcut icon" href="https://www.nguoicodonvn2008.info/favicon.ico">
<link rel="canonical" href="https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/file-json-la-gi-7027.html">
<link rel="alternate" href="https://www.nguoicodonvn2008.info/vi/news/rss/" title="Tin Tức" type="application/rss+xml">
<link rel="alternate" href="https://www.nguoicodonvn2008.info/vi/news/rss/karaoke-dual/" title="Tin Tức - Karaoke Dual" type="application/rss+xml">
<link rel="alternate" href="https://www.nguoicodonvn2008.info/vi/news/rss/nhac-tre/" title="Tin Tức - Nhạc trẻ" type="application/rss+xml">
<link rel="alternate" href="https://www.nguoicodonvn2008.info/vi/news/rss/tru-tinh/" title="Tin Tức - Trữ tình" type="application/rss+xml">
<link rel="alternate" href="https://www.nguoicodonvn2008.info/vi/news/rss/nuoc-ngoai/" title="Tin Tức - Nước ngoài" type="application/rss+xml">
<link rel="alternate" href="https://www.nguoicodonvn2008.info/vi/news/rss/remix/" title="Tin Tức - Remix" type="application/rss+xml">
<link rel="alternate" href="https://www.nguoicodonvn2008.info/vi/news/rss/tam-su-tinh-yeu/" title="Tin Tức - Tâm sự tình yêu" type="application/rss+xml">
<link rel="alternate" href="https://www.nguoicodonvn2008.info/vi/news/rss/tho-suu-tam/" title="Tin Tức - Thơ sưu tầm" type="application/rss+xml">
<link rel="alternate" href="https://www.nguoicodonvn2008.info/vi/news/rss/cuoc-song/" title="Tin Tức - Cuộc sống" type="application/rss+xml">
<link rel="alternate" href="https://www.nguoicodonvn2008.info/vi/news/rss/phan-mem/" title="Tin Tức - Phần mềm" type="application/rss+xml">
<link rel="alternate" href="https://www.nguoicodonvn2008.info/vi/news/rss/kien-thuc-may-tinh/" title="Tin Tức - Kiến thức máy tính" type="application/rss+xml">
<link rel="alternate" href="https://www.nguoicodonvn2008.info/vi/news/rss/hoc-tap/" title="Tin Tức - Học tập" type="application/rss+xml">
<link rel="alternate" href="https://www.nguoicodonvn2008.info/vi/news/rss/tai-lieu/" title="Tin Tức - Tài liệu" type="application/rss+xml">
<link rel="alternate" href="https://www.nguoicodonvn2008.info/vi/news/rss/de-thi/" title="Tin Tức - Đề thi" type="application/rss+xml">
<link rel="preload" as="style" href="https://www.nguoicodonvn2008.info/assets/css/font-awesome.min.css" type="text/css">
<link rel="preload" as="style" href="https://www.nguoicodonvn2008.info/themes/default/css/bootstrap.non-responsive.css" type="text/css">
<link rel="preload" as="style" href="https://www.nguoicodonvn2008.info/themes/default/css/style.css" type="text/css">
<link rel="preload" as="style" href="https://www.nguoicodonvn2008.info/themes/default/css/style.non-responsive.css" type="text/css">
<link rel="preload" as="style" href="https://www.nguoicodonvn2008.info/themes/default/css/news.css" type="text/css">
<link rel="preload" as="style" href="https://www.nguoicodonvn2008.info/themes/default/css/custom.css" type="text/css">
<link rel="preload" as="script" href="https://www.nguoicodonvn2008.info/assets/js/jquery/jquery.min.js" type="text/javascript">
<link rel="preload" as="script" href="https://www.nguoicodonvn2008.info/assets/js/language/vi.js" type="text/javascript">
<link rel="preload" as="script" href="https://www.nguoicodonvn2008.info/assets/js/DOMPurify/purify3.js" type="text/javascript">
<link rel="preload" as="script" href="https://www.nguoicodonvn2008.info/assets/js/global.js" type="text/javascript">
<link rel="preload" as="script" href="https://www.nguoicodonvn2008.info/assets/js/site.js" type="text/javascript">
<link rel="preload" as="script" href="https://www.nguoicodonvn2008.info/themes/default/js/news.js" type="text/javascript">
<link rel="preload" as="script" href="https://www.nguoicodonvn2008.info/themes/default/js/main.js" type="text/javascript">
<link rel="preload" as="script" href="https://www.nguoicodonvn2008.info/themes/default/js/custom.js" type="text/javascript">
<link rel="preload" as="script" href="https://www.nguoicodonvn2008.info/themes/default/js/bootstrap.min.js" type="text/javascript">
<link rel="stylesheet" href="https://www.nguoicodonvn2008.info/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="https://www.nguoicodonvn2008.info/themes/default/css/bootstrap.non-responsive.css">
<link rel="stylesheet" href="https://www.nguoicodonvn2008.info/themes/default/css/style.css">
<link rel="stylesheet" href="https://www.nguoicodonvn2008.info/themes/default/css/style.non-responsive.css">
<link rel="StyleSheet" href="https://www.nguoicodonvn2008.info/themes/default/css/news.css">
<link rel="stylesheet" href="https://www.nguoicodonvn2008.info/themes/default/css/custom.css">
<style type="text/css">
	body{background: #fff;}
</style>
    </head>
    <body>
<div id="print">
	<div id="hd_print">
		<h2 class="pull-left">.&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;.</h2>
		<p class="pull-right"><a title=".&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;." href="https://www.nguoicodonvn2008.info/">https://www.nguoicodonvn2008.info</a></p>
	</div>
	<div class="clear"></div>
	<hr />
	<div id="content">
		<h1>File JSON là gì?</h1>
		<ul class="list-inline">
			<li>Thứ hai - 24/04/2023 00:51</li>
			<li class="hidden-print txtrequired"><em class="fa fa-print">&nbsp;</em><a title="In ra" href="javascript:;" onclick="window.print()">In ra</a></li>
			<li class="hidden-print txtrequired"><em class="fa fa-power-off">&nbsp;</em><a title="Đóng cửa sổ này" href="javascript:;" onclick="window.close()">Đóng cửa sổ này</a></li>
		</ul>
		<div class="clear"></div>
		<div id="hometext">
		</div>
				<div class="imghome">
			<img alt="File JSON là gì?" src="https://st.quantrimang.com/photos/image/2023/04/17/file-json-1.jpg" width="460" class="img-thumbnail" />
		</div>
		<div class="clear"></div>
		<div id="bodytext" class="clearfix">
			<h2 style="text-align: justify;">File JSON là gì?</h2>

<p style="text-align: justify;">JSON (JavaScript Object Notation) là một định dạng file tiêu chuẩn mở để chia sẻ dữ liệu sử dụng văn bản mà con người có thể đọc được để lưu trữ và truyền dữ liệu. Các file JSON được lưu trữ với phần mở rộng .json. JSON yêu cầu ít định dạng hơn và là một giải pháp thay thế tốt cho&nbsp;XML. JSON có nguồn gốc từ&nbsp;JavaScript&nbsp;nhưng là định dạng dữ liệu độc lập với ngôn ngữ. Việc tạo và phân tích cú pháp JSON được hỗ trợ bởi nhiều ngôn ngữ lập trình hiện đại.&nbsp;<em>application/json</em>&nbsp;là loại phương tiện được sử dụng cho JSON.</p>

<figure>
<div style="text-align: justify;"><img alt="File JSON" data-i="0" data-src="https://st.quantrimang.com/photos/image/2023/04/17/file-json-1.jpg" data-was-processed="true" height="839" src="https://st.quantrimang.com/photos/image/2023/04/17/file-json-1.jpg" width="1000" /></div>

<figcaption>
<div style="text-align: justify;">File JSON</div>
</figcaption>
</figure>

<h2 style="text-align: justify;">Lịch sử tóm tắt về định dạng file JSON</h2>

<p style="text-align: justify;">Nhu cầu giao tiếp giữa server và client trong thời gian thực đã dẫn đến việc tạo ra JSON. Định dạng JSON lần đầu tiên được chỉ định bởi Douglas Crockford vào tháng 3 năm 2001. JSON dựa trên tiêu chuẩn ECMA-262 Phiên bản thứ 3 - tháng 12 năm 1999, đây là một tập hợp con của JavaScript.</p>

<p style="text-align: justify;">Phiên bản đầu tiên của tiêu chuẩn JSON ECMA-404 được xuất bản vào tháng 10 năm 2013 bởi Ecma International. RFC 7159 đã trở thành tài liệu tham khảo chính cho việc sử dụng Internet của JSON vào năm 2014. Vào tháng 11 năm 2017, ISO/IEC 21778:2017 đã được xuất bản dưới dạng tiêu chuẩn quốc tế. RFC 8259 được The Internet Engineering Task Force xuất bản vào ngày 13 tháng 12 năm 2017, đây là phiên bản hiện tại của tiêu chuẩn Internet STD 90.</p>

<h2 style="text-align: justify;">Cấu trúc file JSON</h2>

<p style="text-align: justify;">Dữ liệu JSON được ghi theo cặp key/giá trị. Key và giá trị được phân tách bằng dấu hai chấm (:) ở giữa với key ở bên trái và giá trị ở bên phải. Các cặp key/giá trị khác nhau được phân tách bằng dấu phẩy (,). Key là một chuỗi được bao quanh bởi dấu ngoặc kép, ví dụ: “name”. Các giá trị có thể thuộc các loại sau.</p>

<ul>
	<li style="text-align: justify;">Con số</li>
	<li style="text-align: justify;">Chuỗi: Chuỗi ký tự Unicode được bao quanh bởi dấu ngoặc kép.</li>
	<li style="text-align: justify;">Boolean: True hoặc False.</li>
	<li style="text-align: justify;">Mảng: Ví dụ danh sách các giá trị được bao quanh bởi dấu ngoặc vuông</li>
</ul>

<pre id="pre0">
<code>&#91; &quot;Apple&quot;, &quot;Banana&quot;, &quot;Orange&quot; &#93;</code></pre>

<ul>
	<li style="text-align: justify;">Đối tượng: Ví dụ, tập hợp các cặp key/giá trị được bao quanh bởi dấu ngoặc nhọn</li>
</ul>

<pre id="pre1">
<code>{&quot;name&quot;: &quot;Jack&quot;, &quot;age&quot;: 30, &quot;favoriteSport&quot; : &quot;Football&quot;}</code></pre>

<p style="text-align: justify;">Các đối tượng JSON cũng có thể được lồng vào nhau để thể hiện cấu trúc của dữ liệu. Dưới đây là một ví dụ về đối tượng JSON.</p>

<h2 style="text-align: justify;">Ví dụ định dạng JSON</h2>

<pre id="pre2">
<code>{
   &quot;name&quot;:&quot;Jack&quot;,
   &quot;age&quot;:30,
   &quot;contactNumbers&quot;:&#91;
      {
         &quot;type&quot;:&quot;Home&quot;,
         &quot;number&quot;:&quot;123 123-123&quot;
      },
      {
         &quot;type&quot;:&quot;Office&quot;,
         &quot;number&quot;:&quot;321 321-321&quot;
      }
   &#93;,
   &quot;spouse&quot;:null,
   &quot;favoriteSports&quot;:&#91;
      &quot;Football&quot;,
      &quot;Cricket&quot;
   &#93;
}</code></pre>

<h2 style="text-align: justify;">Kích thước tối đa của file JSON là bao nhiêu?</h2>

<p style="text-align: justify;">Thực tế không có giới hạn về kích thước tối đa của file JSON. Nó có thể dài bằng khoảng trống theo yêu cầu của nội dung được lưu trữ.</p>

<p style="text-align: justify;">Khi nói đến việc sử dụng định dạng file JSON để truyền dữ liệu qua Internet, người ta cần cẩn thận về các tài nguyên có sẵn của máy tính. Nếu dữ liệu JSON lớn được truyền, quá trình truyền sẽ bị ảnh hưởng nếu trình duyệt client có bộ nhớ hạn chế.</p>

<p style="text-align: justify;">Không có giới hạn cố định nào được xác định theo thông số kỹ thuật, nhưng bạn cần cẩn thận để không làm cạn kiệt tài nguyên trên máy tính của người dùng, vì nó sẽ nhanh chóng làm giảm trải nghiệm người dùng và họ có thể sẽ từ bỏ ứng dụng của bạn.</p>

<h2 style="text-align: justify;">JSON có gì vượt trội hơn so với XML?</h2>

<p style="text-align: justify;">XML là một định dạng file phổ biến và được sử dụng rộng rãi khác để trao đổi dữ liệu qua Internet. Khi nói đến việc trao đổi dữ liệu giữa những ứng dụng, các nhà phát triển có tùy chọn sử dụng cả định dạng file XML và JSON. Tuy nhiên, JSON được coi là cách thuận tiện nhất để trao đổi dữ liệu giữa các ứng dụng qua Internet vì những lý do sau.</p>

<ul>
	<li style="text-align: justify;">JSON cung cấp chế độ xem dữ liệu rõ ràng và dễ đọc hơn so với các định dạng file XML</li>
	<li style="text-align: justify;">JSON giảm chi phí truyền dữ liệu qua Internet vì nó có ít ký tự hơn để xác định cùng một bộ dữ liệu so với XML</li>
	<li style="text-align: justify;">Các ngôn ngữ lập trình hiện đại cung cấp trình phân tích cú pháp dựng sẵn để phân tích cú pháp phản hồi JSON trên web.</li>
</ul>
		</div>
				<div id="author">
						<p>
				<strong>Nguồn tin:</strong>
				Quantrimang.com
			</p>
		</div>
	</div>
	<div id="footer" class="clearfix">
		<div id="url">
			<strong>URL của bản tin này: </strong><a href="https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/file-json-la-gi-7027.html" title="File JSON là gì?">https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/file-json-la-gi-7027.html</a>

		</div>
		<div class="clear"></div>
		<div class="copyright">
			&copy; .&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;.
		</div>
		<div id="contact">
			<a href="mailto:admin@nguoicodonvn2008.info">admin@nguoicodonvn2008.info</a>
		</div>
	</div>
</div>
        <div id="timeoutsess" class="chromeframe">
            Bạn đã không sử dụng Site, <a onclick="timeoutsesscancel();" href="https://www.nguoicodonvn2008.info/#">Bấm vào đây để duy trì trạng thái đăng nhập</a>. Thời gian chờ: <span id="secField"> 60 </span> giây
        </div>
        <div id="openidResult" class="nv-alert" style="display:none"></div>
        <div id="openidBt" data-result="" data-redirect=""></div>
		</script>
		<div class="car-top">
  <span><img src="https://www.nguoicodonvn2008.info/themes/default/images/car.png" alt=""></span>
</div>
<script src="https://www.nguoicodonvn2008.info/assets/js/jquery/jquery.min.js"></script>
<script>var nv_base_siteurl="/",nv_lang_data="vi",nv_lang_interface="vi",nv_name_variable="nv",nv_fc_variable="op",nv_lang_variable="language",nv_module_name="news",nv_func_name="savefile",nv_is_user=0, nv_my_ofs=-4,nv_my_abbr="EDT",nv_cookie_prefix="nv4c_e856T",nv_check_pass_mstime=1738000,nv_area_admin=0,nv_safemode=0,theme_responsive=0,nv_recaptcha_ver=2,nv_recaptcha_sitekey="",nv_recaptcha_type="image",XSSsanitize=1;</script>
<script src="https://www.nguoicodonvn2008.info/assets/js/language/vi.js"></script>
<script src="https://www.nguoicodonvn2008.info/assets/js/DOMPurify/purify3.js"></script>
<script src="https://www.nguoicodonvn2008.info/assets/js/global.js"></script>
<script src="https://www.nguoicodonvn2008.info/assets/js/site.js"></script>
<script src="https://www.nguoicodonvn2008.info/themes/default/js/news.js"></script>
<script src="https://www.nguoicodonvn2008.info/themes/default/js/main.js"></script>
<script src="https://www.nguoicodonvn2008.info/themes/default/js/custom.js"></script>
<script type="application/ld+json">
        {
            "@context": "https://schema.org",
            "@type": "Organization",
            "url": "https://www.nguoicodonvn2008.info",
            "logo": "https://www.nguoicodonvn2008.info/uploads/angel.gif"
        }
        </script>
<script src="https://www.nguoicodonvn2008.info/themes/default/js/bootstrap.min.js"></script>
<script type="text/javascript">
var $scrolltop = $('.car-top');
$scrolltop.on('click', function () {
    $('html,body').animate({
        scrollTop: 0
    }, 800);
    $(this).addClass("car-run");
    setTimeout(function(){ $scrolltop.removeClass('car-run');}, 1000);
    return false;
});
$(window).on('scroll', function ()
{ 
    if($(window).scrollTop() >= 200)
    {
        $scrolltop.addClass("show");
        $scrolltop.addClass("car-down");
    }
    else
    {
       $scrolltop.removeClass("show");
       setTimeout(function(){ $scrolltop.removeClass('car-down');}, 300);
    }
});
</script>
</body>
</html>