私は本当に奇妙な問題を抱えています。サブオブジェクトにアクセスしようとしていますが、機能しません。最も簡単な方法は、FireBugのコンソール出力を表示することです。
console.log(DesignDocument)
DesignDocument: mwrNsBrowser
html: e.fn.e.init[1]
name: "Game Design Document"
rootName: "Game Design Document"
__proto__: Object
afterLoadCategory: function (bitData, catName)...
bits: Object
hide: function ()...
html: ""
loadCategory: function (catName, parentBit)...
name: ""
rootName: ""
show: function ()...
tmp: Object
今、私はプロトタイプで定義された「ビット」オブジェクトにアクセスしようとしています。うまくいきます。
console.log(DesignDocument.bits)
Object
DocumentSet1: Array[1]
0: mwrBrowserBit
length: 1
しかし、ここに問題があります。「DocumentSet1」配列を取得しようとしています。
var selector = "DocumentSet1";
console.log(DesignDocument.bits[selector])
undefined
そして、それは単に「未定義」を返します!私は現在、なぜこれが機能しないのかについての考えがありません。誰かが私があまりにも馬鹿だったと私に言うことができることを願っています...