title: How do I use JQuery inside a constructor function inside a JS namespace?
body: <p>OK, yesterday I asked about this but there was a stupid bug in my code so I ended up getting the answer to the wrong question.</p>
  
  <p>I want to use JQuery inside a javascript constructor function, which sits inside a namespace:</p>
  
  <pre><code>var NS=NS||{};
  
  NS.constructor=function()
  {
      this.problem="doing my head in"
      this.solution="looking very messy"
  
      function useJQuery()
      {
          $(document).ready
          (
               function()
              {
                   $('body').html("I've written out the whole 'document ready function thing");
              }
           )
      }
  
      function usePlainJS()
      {
              return "Now I'm using plain JS";
      }
  
      function useJQueryAgain()
      {
          $(document).ready
          (
              function()
              {
                  $('body').html("Now I've written out the 'document ready' thing AGAIN!");
              }
           )
      }
  </code></pre>
  
  <p>}</p>
  
  <p>Is there a better way of doing this, without writing out the whole 'document ready' thing every time I want to use JQuery?</p>