当我写book.main.method();
我得到错误:Uncaught TypeError: Object function () {
window.book = window.book|| {};
book.control = function() {
var check_is_ready = 'check_is_ready';
if(check_is_ready == 'check_is_ready') {
this.startbook = function() {
var bookMain = new book.main();
bookMain.method();
return;
};
};
};
$(function() {
var control = new book.control();
control.startbook();
});
(function () {
book.main = function() {
var index =0;
this.method = function() {
index++;
if (index <= 500){
book.main.method();// <-- this wrong
// the error which I get :Uncaught TypeError: Object function () {
alert (index);
}
};
};
})();
我应该写什么book.main.method();
来调用它而不出错?
非常感谢