var key1 = something;
var key2 = something;
var value1 = something;
var value2 = something;
pub.call_response = function() {
return {
units: [
{
test_attributes: {
key1: value1,
key2: value2
}
}
]
};
};
:私は次のように
test_attributes
のキー/値のために使用する必要がある変数の集合を有する
pub.call_response = function() {
return {
units: [
{
test_attributes: {
}
}
]
};
};
を
明らかに、これは機能しません。誰もこのようなことをする方法に関するアイデアはありますか? jQueryの使用は容認できます。
ありがとうございます!あなたもそう角括弧[]
を使用することができ、オブジェクトobj
(すなわちprop.obj
)のプロパティprop
を参照するために