Advertisement
Guest User

Untitled

a guest
Jan 7th, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. window.book = window.book|| {};
  2.  
  3. window.book = {
  4.   control: function() {
  5.     var check_is_ready = 'check_is_ready';
  6.     if(check_is_ready == 'check_is_ready') {
  7.       this.startbook = function() {
  8.         var bookMain = new book.main();
  9.         bookMain.method();
  10.         return;
  11.       };
  12.     };  
  13.   },
  14.  
  15.   main: function() {    
  16.     var index =0;
  17.     this.method = function() {
  18.       index++;
  19.       if (index <= 500){
  20.         book.main.method();//  <-- this wrong
  21.         // the error which I get :Uncaught TypeError: Object function () {
  22.         alert (index);
  23.       }
  24.     };
  25.   };
  26. }
  27.  
  28. $(function() {
  29.     var control = new book.control();
  30.     control.startbook();
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement