0
我已經安裝這個js對象:訪問一般的JavaScript對象屬性
var tableTypes = {
"stockRcmnd":{
"name":"stockRcmnd",
"columns": ['1','2', '3']
},
"stockChange":{
"name":"stockChange",
"columns": ['4','5', '6']
}
};
現在
,我想獲得的列,動態:
property = "stockChange";
columns = tableTypes.{property}.columns;
property = "stockRcmnd";
columns = tableTypes.{property}.columns;
here是的jsfiddle;
任何想法如何做到這一點?
感謝了很多,它的小東西 – devmonster