title: jquery - function not defined - calling this function from inline script
body: <p>I have the code as shown below. Have removed unwanted code from this, just wrote what was needed. When I call my toggleFunc from inline script in body, it shown in console that this function is not defined. Can anyone please tell me whats wrong with this?</p>
  
  <pre><code>&lt;head&gt;
  &lt;script src="~/Client/js/lib/jquery-1.10.2.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function(){
          var pageInitialize = function () {  
  
              ..doing something here
  
              function toggleFunc() { 
                 ..doing something more here
              };
          };
          pageInitialize();
      });
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script&gt;toggleFunc()&lt;/script&gt;
  &lt;/body&gt;
  </code></pre>