title: access a function inside a javascript object
body: <p>I'm having trouble accessing a function inside an object.</p>
  
  <p>My setup is as such..</p>
  
  <pre><code>google.setOnLoadCallback(function(){$(document).ready(CareersInit);});
  
  function CareersInit()
  {
       CAREERS = new Careers();
       CAREERS.init();
  }
  
  function Careers()
  {
       this.init = function()
       {
           function initialize() 
           {
               //Usual google maps stuff here
           }
       }
  
      $('body').bind('onload', function() {
          initialize();
      });
  }
  </code></pre>
  
  <p>With this setup, initialize doesn't run but if I take my google maps variables/functions out of the initialize function then it work's but my understanding (from google docs) is that initialize should always be a function that contains the google maps variables/functions etc.</p>
  
  <p>Even if that is the right way to go it would be great to find out how to access functions when they are inside an objects method just for debug purposes in the console. I thought</p>
  
  <pre><code>CAREERS.init.initialize(); 
  </code></pre>
  
  <p>would work but it doesn't.</p>
  
  <p>Any help or advice would be greatly appreciated.</p>
  
  <p>Thanks</p>
  
  <p>Giles</p>