2012-10-23 26 views
1
[ 
{ 
"_id": "Some Comments.", 
"Loan Name": "College Access", 
"Description": "Some Comments.", 
"Signer": "Some Comments.", 
"Co-signer": "Some Comments.", 
"Interest Rate": "0.0525", 
"Deferment": "Some Comments." 
}] 

這是我使用的JSON。我想在我的項目中檢索Loan Name值,但是有一個空間存在,如果我直接通過多行標記問題給出貸款名稱。我不知道如何解決它。如何訪問java腳本中的值。多行參數

請任何幫助來解決這個問題。

在此先感謝。

+0

這意味着什麼用**「多行標記問題」 ** – diEcho

回答

1

數組符號也適用於JSON。因爲你只需要一個單一的記錄陣列,無父:

var test=[ 
{ 
"_id": "Some Comments.", 
"Loan Name": "College Access", 
"Description": "Some Comments.", 
"Signer": "Some Comments.", 
"Co-signer": "Some Comments.", 
"Interest Rate": "0.0525", 
"Deferment": "Some Comments." 
}] 

alert(test[0]['Loan Name']); 

工作