title: How do fix :"Cannot read property 'init' of undefined TypeError"?
body: <p>I using Jquery-3.2.1, Jquery-Ui 1.12.1.In my JavaScript file:</p>
  
  <pre><code>window.TruyenOnlineScript = (function () {
      var _this = {};
  
      _this.init = function () {
          _this.initSearchMobile();
          _this.initSidebar();
      };   
  
      _this.initSearchMobile = function () {
          //Open Input Search Mobile
          $('.js-open-search-box-mobile').on('click', function (event) {
              event.preventDefault();
              $('body').addClass('open-search-box');
              setTimeout(function () {
                  $('#js-search-input-mobile').focus()
              }, 500);
          });
      };
  
      _this.initSidebar = function () {
          //Open Navbar Moblie
          $('.js-open-sidebar').on('click', function (event) {
              event.preventDefault();
              event.stopPropagation();
              $('body').addClass('open-sidebar');
          });
      };
  
  })();
  
  $('document').ready(function () {
      window.TruyenOnlineScript.init();
  });
  </code></pre>
  
  <p>But I got the error "init of undefined":</p>
  
  <p><a href="https://i.stack.imgur.com/eE242.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eE242.png" alt="enter image description here"></a></p>
  
  <p>Can anybody show me how to fix it? Thank you!</p>