JSON ﺭﻮﺘﺳﺩ


فهرست مطالب

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


.ﺖﺳﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻮﺤﻧ ﺯﺍ ﯼﺍ ﻪﻋﻮﻤﺠﻣ ﺮﯾﺯ JSON ﻮﺤﻧ


JSON ﯼﻮﺤﻧ ﻦﯿﻧﺍﻮﻗ

:ﺖﺳﺍ ﻩﺪﺷ ﻖﺘﺸﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯽﺷ ﯼﺭﺍﺬﮔ ﻪﻧﺎﺸﻧ ﻮﺤﻧ ﺯﺍ JSON ﻮﺤﻧ

  • ﺪﻨﺘﺴﻫ ﺭﺍﺪﻘﻣ/ﻡﺎﻧ ﺖﻔﺟ ﺕﺭﻮﺻ ﻪﺑ ﺎﻫ ﻩﺩﺍﺩ

  • ﺪﻧﻮﺷ ﯽﻣ ﺍﺪﺟ ﻢﻫ ﺯﺍ ﺎﻣﺎﮐ ﺎﺑ ﺎﻫ ﻩﺩﺍﺩ

  • ﺪﻧﺭﺍﺩ ﯽﻣ ﻪﮕﻧ ﺍﺭ ﻡﺎﺴﺟﺍ ﯼﺮﻓﺮﻓ ﯼﺎﻫ ﺲﯾﺮﺑ

  • ﺪﻧﺭﺍﺩ ﯽﻣ ﻪﮕﻧ ﺍﺭ ﺎﻫ ﻪﯾﺍﺭﺁ ﻊﺑﺮﻣ ﯼﺎﻫ ﺖﮐﺍﺮﺑ


ﺭﺍﺪﻘﻣ ﮏﯾ ﻭ ﻡﺎﻧ ﮏﯾ - JSON ﯼﺎﻫ ﻩﺩﺍﺩ

.ﺪﻧﻮﺷﯽﻣ ﻪﺘﺷﻮﻧ (ﺭﺍﺪﻘﻣ/ﺪﯿﻠﮐ ﯼﺎﻫﺖﻔﺟ ﺭﺎﻌﺘﺴﻣ ﻡﺎﻧ ﺎﺑ) ﺭﺍﺪﻘﻣ/ﻡﺎﻧ ﺖﻔﺟ ﺕﺭﻮﺻ ﻪﺑ JSON

.ﺖﺳﺍ ﻩﺪﺷ ﻞﯿﮑﺸﺗ (ﻪﻣﻮﯿﮔ ﻭﺩ ﺭﺩ) ﺪﻠﯿﻓ ﻡﺎﻧ ﮏﯾ ﺯﺍ ﺭﺍﺪﻘﻣ/ﻡﺎﻧ ﺖﻔﺟ ﮏﯾ

ﻝﺎﺜﻣ

"name":"John"

.ﺪﻧﺭﺍﺩ ﺯﺎﯿﻧ ﻪﻧﺎﮔﻭﺩ ﯼﺎﻫ ﻝﻮﻗ ﻞﻘﻧ ﻪﺑ JSON ﯼﺎﻫ ﻡﺎﻧ


JSON - ﺪﻨﮐ ﯽﻣ ﯽﺑﺎﯾﺯﺭﺍ ﺍﺭ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ءﺎﯿﺷﺍ

.ﺖﺳﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ءﺎﯿﺷﺍ ﻪﺑﺎﺸﻣ ﺎًﺒﯾﺮﻘﺗ JSON ﺖﻣﺮﻓ

:ﺪﻧﻮﺷ ﻪﺘﺷﻮﻧ ﯽﯾﺎﺗﻭﺩ ﯼﺎﻫﻪﻣﻮﯿﮔ ﺎﺑ ﻪﮐ ﺪﻨﺷﺎﺑ ﯼﺍﻪﺘﺷﺭ ﺪﯾﺎﺑ ﺎﻫﺪﯿﻠﮐ

JSON

{"name":"John"}

:ﺪﻨﺷﺎﺑ ﻪﺳﺎﻨﺷ ﯼﺎﻫ ﻡﺎﻧ ﺎﯾ ﺩﺍﺪﻋﺍ ،ﺎﻫ ﻪﺘﺷﺭ ﺪﻨﻧﺍﻮﺗ ﯽﻣ ﺎﻫﺪﯿﻠﮐ ،ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺭﺩ

ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

{name:"John"}


ﺮﯾﺩﺎﻘﻣ JSON

:ﺪﺷﺎﺑ ﺮﯾﺯ ﻩﺩﺍﺩ ﻉﺍﻮﻧﺍ ﺯﺍ ﯽﮑﯾ ﺪﯾﺎﺑ ﺎﻫﺭﺍﺪﻘﻣJSON، ﺭﺩ

  • ﻪﺘﺷﺭ ﮏﯾ

  • ﺩﺪﻋ ﮏﯾ

  • ﯽﺷ ﮏﯾ

  • ﻪﯾﺍﺭﺁ ﮏﯾ

  • ﯽﻟﻮﺑ ﮏﯾ

  • ﯽﻟﺎﺧ

.ﺪﻨﺷﺎﺑ ﯼﺮﮕﯾﺩ ﺮﺒﺘﻌﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺮﻫ ﻪﻓﺎﺿﺍ ﻪﺑ ،ﻻﺎﺑ ﺩﺭﺍﻮﻣ ﻪﻤﻫ ﺪﻨﻧﺍﻮﺗﯽﻣ ﺮﯾﺩﺎﻘﻣ

  • ﻊﺑﺎﺗ ﮏﯾ

  • ﺦﯾﺭﺎﺗ ﮏﯾ

  • ﻩﺪﺸﻧ ﻒﯾﺮﻌﺗ

:ﺪﻧﻮﺷ ﻪﺘﺷﻮﻧ ﻪﻣﻮﯿﮔ ﻭﺩ ﺎﺑ ﺪﯾﺎﺑ ﻪﺘﺷﺭ ﺮﯾﺩﺎﻘﻣ

JSON

{"name":"John"}

:ﺪﯿﺴﯾﻮﻨﺑ ﮏﺗ ﺎﯾ ﻪﻣﻮﯿﮔ ﻭﺩ ﺎﺑ ﺍﺭ ﯼﺍﻪﺘﺷﺭ ﺮﯾﺩﺎﻘﻣ ﺪﯿﻧﺍﻮﺗﯽﻣ ،ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

{name:'John'}

ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ءﺎﯿﺷﺍ

ﺖﺳﺍ ﯽﻓﺎﺿﺍ ﯽﻤﮐ ﺭﺎﯿﺴﺑ ،ﺖﺳﺍ ﻩﺪﺷ ﻖﺘﺸﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯽﺷ ﯼﺭﺍﺬﮔ ﻪﻧﺎﺸﻧ ﺯﺍ JSON ﻮﺤﻧ ﻪﮐ ﺎﺠﻧﺁ ﺯﺍ

ﺪﯿﻫﺩ ﺹﺎﺼﺘﺧﺍ ﻥﺁ ﻪﺑ ﺍﺭ ﺎﻫ ﻩﺩﺍﺩ ﻭ ﺪﯿﻨﮐ ﺩﺎﺠﯾﺍ ﯽﺷ ﮏﯾ ﺪﯿﻧﺍﻮﺗ ﯽﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺎﺑ

ﻝﺎﺜﻣ

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 ﺕﺭﻮﺻ ﻪﺑ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯼﺎﻫ ﻪﯾﺍﺭﺁ

ﺪﻨﻧﺍﻮﺗ ﯽﻣ ﺰﯿﻧ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯼﺎﻫ ﻪﯾﺍﺭﺁ ،ﺖﺷﻮﻧ JSON ﺕﺭﻮﺻ ﻪﺑ ﺍﺭ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ءﺎﯿﺷﺍ ﻥﺍﻮﺗ ﯽﻣ

.ﺖﺧﻮﻣﺁ ﺪﯿﻫﺍﻮﺧ ﺮﺘﺸﯿﺑ ﺎﻫ ﻪﯾﺍﺭﺁ ﻭ ﺎﯿﺷﺍ ﺩﺭﻮﻣ ﺭﺩ ﺵﺯﻮﻣﺁ ﻦﯾﺍ ﻪﻣﺍﺩﺍ ﺭﺩ


JSON ﯼﺎﻫ ﻞﯾﺎﻓ

  • ﺖﺳﺍ "JSON ".json ﯼﺎﻫ ﻞﯾﺎﻓ ﯼﺍﺮﺑ ﻞﯾﺎﻓ ﻉﻮﻧ

  • ﺖﺳﺍ "JSON "application/json ﻦﺘﻣ ﯼﺍﺮﺑ MIME ﻉﻮﻧ

تمامی حقوق محفوظ است. © BasicIT.org • 2023-2024