¾È±Ô °øºÎ¹æ

Javascript & JQuery & CSS > JSON ±¸Á¶ ¾Ë¾Æº¸±â

µî·ÏÀÏ : 2017-07-14 16:55 Á¶È¸¼ö : 53,113

	var JSONObject = {
		"name":"À¯Àç¼®",
		"street":"¼­¿ïƯº°½Ã", 
		"age":41,
		"phone":"011 1234 5678"};
		
		document.getElementById("jname").innerHTML=JSONObject.name  
		document.getElementById("jage").innerHTML=JSONObject.age  
		document.getElementById("jstreet").innerHTML=JSONObject.street  
		document.getElementById("jphone").innerHTML=JSONObject.phone  
À§ÀÇ °á°ú¸¦ º¸¸é, À¯Àç¼®, ¼­¿ïƯº°½Ã, 41¼¼, 011 1234 5678 ó·³ °á°ú°¡ ³ª¿À´Âµ¥ ÀÌ·± µ¥ÀÌÅ͸¦ ÀúÀåÇÏ´Â Çü½ÄÀº key °ª°ú value °ªÀ¸·Î ³ª´©¾î Áø´Ù.

JSON ¹®ÀÚ¿­À» º¸¸é ¾Æ·¡¿Í °°ÀÌ ¼±¾ð ÇÒ ¼ö°¡ ÀÖ´Ù.

var menu = '{ "name": "½ºÆÄ°ÔƼ", "price" : 8000 }'; 

menu.name = ½ºÆÄÄÉƼ
menu.price = 8000

À§Ã³·³ µ¥ÀÌÅÍ °ªÀ» »Ì¾Æ ¿Ã¼ö°¡ ÀÖ´Ù.
¡Ø Ȥ½Ã µµ¿òÀÌ µÇ¼Ì´Ù¸é ´ñ±Û¿¡ ÇѸ¶µð ³²°ÜÁÖ¼¼¿ä!
ÀÛ¼ºÀÚ   ºñ¹Ð¹øÈ£
ÀÚµ¿±Û ¹æÁö     (ÀÚµ¿±Û ¹æÁö ±â´ÉÀÔ´Ï´Ù.)
³»¿ë   ´ñ±Û´Þ±â 
À̸ÞÀÏ ¹®ÀÇ : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.