title: MVC 4 and jQuery getJSON
body: <p>I have to implement some sort of live search in a project at the university. I have the following code:
  MVC Action:</p>
  
  <pre><code>[Authorize]  
  [AcceptVerbs(HttpVerbs.Get)]  
  [InitializeSimpleMembership]
  public JsonResult Search(string term)  
  {  
      var data = ... // get matching item  
      return Json(data, JsonRequestBehavior.AllowGet);  
  }  
  </code></pre>
  
  <p>Script in View:</p>
  
  <pre><code>$(document).ready(function() {  
      $("#searchText").keyup(function() {  
          $.getJSON('/Search/Search', { "term": $(this).val() },  function(result) {   
              alert(result);    
              $("#searchText").val(result.d);  
          });  
      });  
  });
  </code></pre>
  
  <p>The controller action is called and returns the matching objects, but the javascript function is never  called, no alert box, nothing. What can  do to make this work?</p>