title: MVC 4 Unable to call javascript function from another js file
body: <p>I am trying call the loadTimesheet function in object weeklytimesheet from another js file.</p>
  
  <p>I get a Object doesn't support property or method 'loadTimesheet' error.</p>
  
  <p>EDIT: My intellisense in VS2012 is not working either if that has any bearing on it.</p>
  
  <p>mylester.index.js</p>
  
  <pre><code>$(document).ready(function () {
  
      $("#newtimesheet").click(function () {
          weeklytimesheet.loadTimesheet();
      });
  });
  </code></pre>
  
  <p>mylester.weeklytimesheet.js</p>
  
  <pre><code>var weeklytimesheet = new function () {
      load = function () {
          var wkending =  getWeekEnding();
          var proId = $("#newtimesheet").attr("proid");
          $("#divtimesheet").load("/Timesheet/NewTimesheet", new { proId: proID, enddate: wkending });
          open();
      };
  
      open = function() {
          $("#clipboarddialog").dialog({
              autoOpen: true,
              height: 800,
              width: 860,
              modal: true,
              title: "Edit Timesheet",
              buttons: {
                  "Save": function () {
                      editorForm.saveForm();
                      $(this).dialog("close")
                  },
                  Cancel: function () { $(this).dialog("close") }
              }
          });
  
      };
  
      getWeekEnding = function () {
          var wkending;
          $(".datepicker").datepicker();
          $("#datepickerdialog").dialog({
              autoOpen: true,
              close: function () {
                  wkending = $("#weekending").val();
              },
              show: {
                  effect: "blind",
                  duration: 1000
              },
              hide: {
                  effect: "explode",
                  duration: 1000
              }
          });
          return wkending;
      }
  
      return
      {
          loadTimesheet: load
      };
  }();
  </code></pre>