2014-01-27 65 views
0

特定值從以下JSON數據我怎麼能得到address: '172.16.2.18'得到一個JSON數據

我只是想從下面的josn data.How有可能得到172.16.2.18

{ 
    'Local Area Connection': [{ 
     address: 'fe80::c1c6:e78a:ece:435', 
     family: 'IPv6', 
     internal: false 
    }, { 
     address: '172.16.2.18', 
     family: 'IPv4', 
     internal: false 
    }], 
    'VMware Network Adapter VMnet1': [{ 
      address: 'fe80::55d6:5243:74eb:ec58', 
      family: 'IPv6', 
      internal: false 
     }, { 
      address: '169.254.236.88', 
      family: 'IPv4', 
      internal: false 
     } 
     'VMware Network Adapter VMnet8': [{ 
       address: 'fe80::a50c:fc9f:921a:7a22', 
       family: 'IPv6', 
       internal: false 
      }, { 
       address: '169.254.122.34', 
       family: 'IPv4', 
       internal: false 
      } 
      'Loopback Pseudo-Interface 1': [{ 
       address: '::1', 
       family: 'IPv6', 
       internal: true 
      }, { 
       address: '127.0.0.1', 
       family: 'IPv4', 
       internal: true 
      }] 
     } 
+0

如果我可能會問哪種語言?! –

+0

Json用於''「(雙引號)'不用'單'('')' –

+0

是使用node.js – Sush

回答

0

你有幾個語法錯誤的*在你的JSON數據,但一旦得到解決,您可以使用獲得訪問該元素:

var address = jsonData["Local Area Connection"][1].address; 

活生生的例子:http://jsfiddle.net/VBKvZ/

*語法錯誤在每個「適配器列表」後缺少關閉數組和逗號(],