var O = {
elements: {
main: function() { return jQuery("#main"); },
footer: function() { return jQuery("#footer"); }
},
main: function(html) {
return (this.elements.main());
},
style: {
setMaincolor: function() {
// TypeError: Cannot call method 'main' of undefined
return (this.elements.main());
}
}
};
所以; 我是 O.style 对象的父母对象????
O.style.setMaincolor() // TypeError: Cannot call method 'main' of undefined
O.main() // [<div id="main"></div>]
setMaincolor 方法将此返回给 O 对象