JSON ﻪﻣﺪﻘﻣ


فهرست مطالب

    نمایش فهرست مطالب

JSON ﻒﻔﺨﻣ JavaScript Object Notation ﺖﺳﺍ

JSON ﮏﯾ ﯼﺭﺎﺘﺷﻮﻧ ﺖﻣﺮﻓ ﺖﺳﺍ ﻩﺩﺍﺩ ﻝﺎﻘﺘﻧﺍ ﻭ ﻩﺮﯿﺧﺫ ﯼﺍﺮﺑ

JSON "ﺖﺳﺍ ﮎﺭﺩ ﻞﺑﺎﻗ ﯽﺘﺣﺍﺭ ﻪﺑ ﻭ ﺖﺳﺍ "ﻒﯿﺻﻮﺗ ﺩﻮﺧ

JSON ﻝﺎﺜﻣ

:ﺖﺳﺍ JSON ﻪﺘﺷﺭ ﮏﯾ ﻝﺎﺜﻣ ﻦﯾﺍ

'{"name":"John", "age":30, "car":null}'

:ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ ﯽﮔﮋﯾﻭ 3 ﺎﺑ ﺍﺭ ﯽﺷ ﮏﯾ

  • ﻡﺎﻧ

  • ﻦﺳ

  • ﻦﯿﺷﺎﻣ

.ﺖﺳﺍ ﺵﺯﺭﺍ ﮏﯾ ﯼﺍﺭﺍﺩ ﮏﻠﻣ ﺮﻫ

ﺪﯿﺷﺎﺑ ﻪﺘﺷﺍﺩ ﯽﺳﺮﺘﺳﺩ ﺎﻫ ﻩﺩﺍﺩ ﻪﺑ ﺪﯿﻧﺍﻮﺗ ﯽﻣ ،ﺪﯿﻨﮐ ﻪﯾﺰﺠﺗ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻪﻣﺎﻧﺮﺑ ﮏﯾ ﺎﺑ ﺍﺭ JSON

let personName = obj.name;
let personAge = obj.age; 

JSON ؟ﺖﺴﯿﭼ

  • JSON ﻒﻔﺨﻣ JavaScript Object Notation ﺖﺳﺍ

  • JSON ﺖﺳﺍ ﻥﺯﻭ ﮏﺒﺳ ﻩﺩﺍﺩ ﻝﺩﺎﺒﺗ ﺖﻣﺮﻓ ﮏﯾ

  • JSON ﺖﺳﺍ ﻩﺪﺷ ﻪﺘﺷﻮﻧ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯽﺷ ﺩﺎﻤﻧ ﺎﺑ ﻪﮐ ﺖﺳﺍ ﯼﺍ ﻩﺩﺎﺳ ﻦﺘﻣ

  • JSON ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﺎﻫ ﻪﻧﺎﯾﺍﺭ ﻦﯿﺑ ﻩﺩﺍﺩ ﻝﺎﺳﺭﺍ ﯼﺍﺮﺑ

  • JSON ﻥﺎﺑﺯ ﺯﺍ ﻞﻘﺘﺴﻣ * ﺖﺳﺍ

*

.ﺩﺭﺍﺩ ﺩﻮﺟﻭ ﯽﺴﯾﻮﻧ ﻪﻣﺎﻧﺮﺑ ﯼﺎﻫ ﻥﺎﺑﺯ ﺯﺍ ﯼﺭﺎﯿﺴﺑ ﺭﺩ JSON ﺪﯿﻟﻮﺗ ﻭ ﻥﺪﻧﺍﻮﺧ ﯼﺍﺮﺑ ﺪﮐ

ﻂﺳﻮﺗ ﺍﺪﺘﺑﺍ ﺭﺩ JSON ﺐﻟﺎﻗ



؟ﻢﯿﻨﮐ ﻩﺩﺎﻔﺘﺳﺍ JSON ﺯﺍ ﺍﺮﭼ

ﺖﺳﺍ ﻩﺪﺷ ﺩﺎﺠﯾﺍ ﺪﮐ ﻪﯿﺒﺷ ﯼﻮﺤﻧ ﺮﻈﻧ ﺯﺍ JSON ﺖﻣﺮﻓ

.ﺩﺮﮐ ﻝﺎﺳﺭﺍ ﺎﻫ ﻪﻧﺎﯾﺍﺭ ﻦﯿﺑ ﯽﺘﺣﺍﺭ ﻪﺑ ﻥﺍﻮﺗ ﯽﻣ ﺍﺭ JSON ﯼﺎﻫ ﻩﺩﺍﺩ ،ﺖﺳﺍ ﯽﻨﺘﻣ ﻂﻘﻓ ﺖﻣﺮﻓ ﻪﮐ ﯽﯾﺎﺠ

:ﺖﺳﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ءﺎﯿﺷﺍ ﻪﺑ JSON ﯼﺎﻫ ﻪﺘﺷﺭ ﻞﯾﺪﺒﺗ ﯼﺍﺮﺑ ﯽﻠﺧﺍﺩ ﻊﺑﺎﺗ ﮏﯾ ﯼﺍﺭﺍﺩ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

JSON.parse()

:ﺖﺳﺍ JSON ﻪﺘﺷﺭ ﮏﯾ ﻪﺑ ﯽﺷ ﮏﯾ ﻞﯾﺪﺒﺗ ﯼﺍﺮﺑ ﯽﻠﺧﺍﺩ ﻊﺑﺎﺗ ﮏﯾ ﯼﺍﺭﺍﺩ ﻦﯿﻨﭽﻤﻫ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

JSON.stringify()

.ﺪﯿﻨﮐ ﻩﺩﺎﻔﺘﺳﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯽﺷ ﮏﯾ ﻥﺍﻮﻨﻋ ﻪﺑ ﻥﺁ ﺯﺍ ﻭ ﺪﯿﻨﮐ ﺖﻓﺎﯾﺭﺩ ﺭﻭﺮﺳ ﮏﯾ ﺯﺍ ﺍﺭ ﺺﻟﺎﺧ ﻦﺘﻣ

.ﺪﯿﻨﮐ ﻝﺎﺳﺭﺍ ﺭﻭﺮﺳ ﻪﺑ ﺺﻟﺎﺧ ﻦﺘﻣ ﺐﻟﺎﻗ ﺭﺩ ﺍﺭ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯽﺷ ﮏﯾ ﺪﯿﻧﺍﻮﺗ ﯽﻣ ﺎﻤﺷ

ﻩﺪﯿﭽﯿﭘ ﺰﯿﭼ ﭻﯿﻫ ﻥﻭﺪﺑ ،ﺪﯿﻨﮐ ﺭﺎﮐ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ءﺎﯿﺷﺍ ﻥﺍﻮﻨﻋ ﻪﺑ ﺎﻫ ﻩﺩﺍﺩ ﺎﺑ ﺪﯿﻧﺍﻮﺗ ﯽﻣ ﺎﻤﺷ


ﺎﻫ ﻩﺩﺍﺩ ﯼﺯﺎﺳ ﻩﺮﯿﺧﺫ

،ﺪﯿﻨﮐ ﯽﻣ ﻩﺮﯿﺧﺫ ﺍﺭ ﻥﺁ ﺎﺠﮐ ﻪﮑﻨﯾﺍ ﺯﺍ ﺮﻈﻧ ﻑﺮﺻ ﻭ ﺪﻨﺷﺎﺑ ﻪﺘﺷﺍﺩ ﯽﺻﺎﺧ ﺖﻣﺮﻓ ﺪﯾﺎﺑ ﺎﻫ ﻩﺩﺍﺩ ،ﺎﻫ ﻩﺩ

JSON ﺪﻨﮐ ﯽﻣ ﻢﻫﺍﺮﻓ ﻦﺘﻣ ﻥﺍﻮﻨﻋ ﻪﺑ ﺍﺭ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ءﺎﯿﺷﺍ ﻩﺮﯿﺧﺫ ﻥﺎﮑﻣﺍ.