.ﺖﺳﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻮﺤﻧ ﺯﺍ ﯼﺍ ﻪﻋﻮﻤﺠﻣ ﺮﯾﺯ JSON ﻮﺤﻧ
:ﺖﺳﺍ ﻩﺪﺷ ﻖﺘﺸﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯽﺷ ﯼﺭﺍﺬﮔ ﻪﻧﺎﺸﻧ ﻮﺤﻧ ﺯﺍ JSON ﻮﺤﻧ
ﺪﻨﺘﺴﻫ ﺭﺍﺪﻘﻣ/ﻡﺎﻧ ﺖﻔﺟ ﺕﺭﻮﺻ ﻪﺑ ﺎﻫ ﻩﺩﺍﺩ
ﺪﻧﻮﺷ ﯽﻣ ﺍﺪﺟ ﻢﻫ ﺯﺍ ﺎﻣﺎﮐ ﺎﺑ ﺎﻫ ﻩﺩﺍﺩ
ﺪﻧﺭﺍﺩ ﯽﻣ ﻪﮕﻧ ﺍﺭ ﻡﺎﺴﺟﺍ ﯼﺮﻓﺮﻓ ﯼﺎﻫ ﺲﯾﺮﺑ
ﺪﻧﺭﺍﺩ ﯽﻣ ﻪﮕﻧ ﺍﺭ ﺎﻫ ﻪﯾﺍﺭﺁ ﻊﺑﺮﻣ ﯼﺎﻫ ﺖﮐﺍﺮﺑ
.ﺪﻧﻮﺷﯽﻣ ﻪﺘﺷﻮﻧ (ﺭﺍﺪﻘﻣ/ﺪﯿﻠﮐ ﯼﺎﻫﺖﻔﺟ ﺭﺎﻌﺘﺴﻣ ﻡﺎﻧ ﺎﺑ) ﺭﺍﺪﻘﻣ/ﻡﺎﻧ ﺖﻔﺟ ﺕﺭﻮﺻ ﻪﺑ JSON
.ﺖﺳﺍ ﻩﺪﺷ ﻞﯿﮑﺸﺗ (ﻪﻣﻮﯿﮔ ﻭﺩ ﺭﺩ) ﺪﻠﯿﻓ ﻡﺎﻧ ﮏﯾ ﺯﺍ ﺭﺍﺪﻘﻣ/ﻡﺎﻧ ﺖﻔﺟ ﮏﯾ
"name":"John"
.ﺪﻧﺭﺍﺩ ﺯﺎﯿﻧ ﻪﻧﺎﮔﻭﺩ ﯼﺎﻫ ﻝﻮﻗ ﻞﻘﻧ ﻪﺑ JSON ﯼﺎﻫ ﻡﺎﻧ
.ﺖﺳﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ءﺎﯿﺷﺍ ﻪﺑﺎﺸﻣ ﺎًﺒﯾﺮﻘﺗ JSON ﺖﻣﺮﻓ
:ﺪﻧﻮﺷ ﻪﺘﺷﻮﻧ ﯽﯾﺎﺗﻭﺩ ﯼﺎﻫﻪﻣﻮﯿﮔ ﺎﺑ ﻪﮐ ﺪﻨﺷﺎﺑ ﯼﺍﻪﺘﺷﺭ ﺪﯾﺎﺑ ﺎﻫﺪﯿﻠﮐ :ﺪﻨﺷﺎﺑ ﻪﺳﺎﻨﺷ ﯼﺎﻫ ﻡﺎﻧ ﺎﯾ ﺩﺍﺪﻋﺍ ،ﺎﻫ ﻪﺘﺷﺭ ﺪﻨﻧﺍﻮﺗ ﯽﻣ ﺎﻫﺪﯿﻠﮐ ،ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺭﺩJSON
{"name":"John"}
ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ
{name:"John"}
ﺮﯾﺩﺎﻘﻣ JSON
:ﺪﺷﺎﺑ ﺮﯾﺯ ﻩﺩﺍﺩ ﻉﺍﻮﻧﺍ ﺯﺍ ﯽﮑﯾ ﺪﯾﺎﺑ ﺎﻫﺭﺍﺪﻘﻣJSON، ﺭﺩ
ﻪﺘﺷﺭ ﮏﯾ
ﺩﺪﻋ ﮏﯾ
ﯽﺷ ﮏﯾ
ﻪﯾﺍﺭﺁ ﮏﯾ
ﯽﻟﻮﺑ ﮏﯾ
ﯽﻟﺎﺧ
.ﺪﻨﺷﺎﺑ ﯼﺮﮕﯾﺩ ﺮﺒﺘﻌﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺮﻫ ﻪﻓﺎﺿﺍ ﻪﺑ ،ﻻﺎﺑ ﺩﺭﺍﻮﻣ ﻪﻤﻫ ﺪﻨﻧﺍﻮﺗﯽﻣ ﺮﯾﺩﺎﻘﻣ ﻊﺑﺎﺗ ﮏﯾ ﺦﯾﺭﺎﺗ ﮏﯾ ﻩﺪﺸﻧ ﻒﯾﺮﻌﺗ :ﺪﻧﻮﺷ ﻪﺘﺷﻮﻧ ﻪﻣﻮﯿﮔ ﻭﺩ ﺎﺑ ﺪﯾﺎﺑ ﻪﺘﺷﺭ ﺮﯾﺩﺎﻘﻣ :ﺪﯿﺴﯾﻮﻨﺑ ﮏﺗ ﺎﯾ ﻪﻣﻮﯿﮔ ﻭﺩ ﺎﺑ ﺍﺭ ﯼﺍﻪﺘﺷﺭ ﺮﯾﺩﺎﻘﻣ ﺪﯿﻧﺍﻮﺗﯽﻣ ،ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺖﺳﺍ ﯽﻓﺎﺿﺍ ﯽﻤﮐ ﺭﺎﯿﺴﺑ ،ﺖﺳﺍ ﻩﺪﺷ ﻖﺘﺸﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯽﺷ ﯼﺭﺍﺬﮔ ﻪﻧﺎﺸﻧ ﺯﺍ JSON ﻮﺤﻧ ﻪﮐ ﺎﺠﻧﺁ ﺯﺍ ﺪﯿﻫﺩ ﺹﺎﺼﺘﺧﺍ ﻥﺁ ﻪﺑ ﺍﺭ ﺎﻫ ﻩﺩﺍﺩ ﻭ ﺪﯿﻨﮐ ﺩﺎﺠﯾﺍ ﯽﺷ ﮏﯾ ﺪﯿﻧﺍﻮﺗ ﯽﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺎﺑ :ﺪﯿﺷﺎﺑ ﻪﺘﺷﺍﺩ ﯽﺳﺮﺘﺳﺩ ﻦﯾﺍ ﺪﻨﻧﺎﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯽﺷ ﮏﯾ ﻪﺑ ﺪﯿﻧﺍﻮﺗ ﯽﻣ ﺎﻤﺷ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ :ﺖﺳﺍ ﯽﺳﺮﺘﺳﺩ ﻞﺑﺎﻗ ﺰﯿﻧ ﺕﺭﻮﺻ ﻦﯾﺍ ﻪﺑ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ :ﺩﺍﺩ ﺮﯿﯿﻐﺗ ﺮﯾﺯ ﺕﺭﻮﺻ ﻪﺑ ﻥﺍﻮﺗ ﯽﻣ ﺍﺭ ﺎﻫ ﻩﺩﺍﺩ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ :ﺩﺍﺩ ﺮﯿﯿﻐﺗ ﺕﺭﻮﺻ ﻦﯾﺍ ﻪﺑ ﺍﺭ ﻥﺁ ﻥﺍﻮﺗ ﯽﻣ ﻦﯿﻨﭽﻤﻫ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ ﺪﺷ ﺪﯿﻫﺍﻮﺧ ﺎﻨﺷﺁ JSON ﻪﺑ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ءﺎﯿﺷﺍ ﻞﯾﺪﺒﺗ ﻩﻮﺤﻧ ﺎﺑ ﻪﻣﺍﺩﺍ ﺭﺩ ﺪﻨﻧﺍﻮﺗ ﯽﻣ ﺰﯿﻧ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯼﺎﻫ ﻪﯾﺍﺭﺁ ،ﺖﺷﻮﻧ JSON ﺕﺭﻮﺻ ﻪﺑ ﺍﺭ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ءﺎﯿﺷﺍ ﻥﺍﻮﺗ ﯽﻣ .ﺖﺧﻮﻣﺁ ﺪﯿﻫﺍﻮﺧ ﺮﺘﺸﯿﺑ ﺎﻫ ﻪﯾﺍﺭﺁ ﻭ ﺎﯿﺷﺍ ﺩﺭﻮﻣ ﺭﺩ ﺵﺯﻮﻣﺁ ﻦﯾﺍ ﻪﻣﺍﺩﺍ ﺭﺩ ﺖﺳﺍ "JSON ".json ﯼﺎﻫ ﻞﯾﺎﻓ ﯼﺍﺮﺑ ﻞﯾﺎﻓ ﻉﻮﻧ ﺖﺳﺍ "JSON "application/json ﻦﺘﻣ ﯼﺍﺮﺑ MIME ﻉﻮﻧJSON
{"name":"John"}
ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ
{name:'John'}
ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ءﺎﯿﺷﺍ
ﻝﺎﺜﻣ
person = {name:"John", age:31, city:"New York"};
ﻝﺎﺜﻣ
// returns John
person.name;
<!DOCTYPE html>
<html>
<body>
<h2>Access a JavaScript object</h2>
<p id="demo"></p>
<script>
const myObj = {name:"John", age:30, city:"New York"};
document.getElementById("demo").innerHTML = myObj.name;
</script>
</body>
</html>
ﻝﺎﺜﻣ
// returns John
person["name"];
<!DOCTYPE html>
<html>
<body>
<h2>Access a JavaScript object</h2>
<p id="demo"></p>
<script>
const myObj = {name:"John", age:30, city:"New York"};
document.getElementById("demo").innerHTML = myObj["name"];
</script>
</body>
</html>
ﻝﺎﺜﻣ
person.name = "Gilbert";
<!DOCTYPE html>
<html>
<body>
<h2>Modify a JavaScript Object</h2>
<p id="demo"></p>
<script>
const myObj = {name:"John", age:30, city:"New York" };
myObj.name = "Gilbert";
document.getElementById("demo").innerHTML = myObj.name;
</script>
</body>
</html>
ﻝﺎﺜﻣ
person["name"] = "Gilbert";
<!DOCTYPE html>
<html>
<body>
<h2>Modify a JavaScript Object</h2>
<p id="demo"></p>
<script>
const myObj = {name:"John", age:30, city:"New York"};
myObj["name"] = "Gilbert";
document.getElementById("demo").innerHTML = myObj.name;
</script>
</body>
</html>
JSON ﺕﺭﻮﺻ ﻪﺑ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯼﺎﻫ ﻪﯾﺍﺭﺁ
JSON ﯼﺎﻫ ﻞﯾﺎﻓ