title: Uncaught TypeError:Undefined is not a function
body: <p>I get the message <code>Uncaught TypeError:Undefined is not a function</code> when I try to call a the method in my home controller.</p>
  
  <p>Advice perhaps as to why I am getting this message?</p>
  
  <pre><code>findIdpActivities = function (pernr, callback) {
      restEndPoint = serviceBase + 'Home/FindIdpActivities';
      data = "{'perNr':'" + pernr + "'}";
      makeJsonDataAjaxCall(callback);
  };
  
  makeJsonDataAjaxCall = function (callback, obj) {
      $.ajax({
          type: "POST",
          url: restEndPoint,
          contentType: "application/json; charset=utf-8",
          dataType: "json",
          data: data,
          success: function (data) {
              callback(data);
          }
      });
  };
  </code></pre>
  
  <p>executing the method upon button click.</p>
  
  <pre><code>$(document).on("click", "input[name=btnViewActivities]", function (e) {
      e.preventDefault();
      var value = $(this).parent().find("input[name=hiddenPerNr]").val();
      dataService.findIdpActivities(value);
  });
  </code></pre>
  
  <p>and this is the method in the HomeController</p>
  
  <pre><code>[HttpPost]
      public JsonResult FindIdpActivities(string perNr)
      {
          viewModel.GetIdpActivities(perNr);
  
          return Json(new
              {
                  Activities = viewModel.IdpActivities
              });
      }
  </code></pre>