title: jQuery function not working in MVC Partial View
body: <p>The .hide function in my partial view is not rendering for second and third person initially, then the delay .hide and .fadein will not work either. I am new to js and jquery so I am probably missing something obvious... Why would this js script not be working inside of a partial view?</p>
  
  <p>Everything works when it is all in the main view, but the reason I need a partial view is because I do not want to reload the entire page every 15 seconds. I have done some research and there might be something wrong with getting an html data type?</p>
  
  <p>Main View:</p>
  
  <pre><code>@model IEnumerable&lt;project.Models.MyList&gt;
  
  &lt;div id="scrolllist"&gt;
      @Html.Partial("_ScrollList")
  &lt;/div&gt;
  
  @section Scripts{
  &lt;script&gt;
  function loadScrollListPV() {
     $.ajax({
      url: "@Url.Action("ScrollList")",
      type: 'GET', // &lt;-- make a async request by GET
      dataType: 'html', // &lt;-- to expect an html response
      success: function(result) {
                  $('#scrolllist').html(result);
               }
     });
  }
  $(function() {
      loadScrollListPV();
      // re-call the functions each 15 seconds
      window.setInterval("loadScrollListPV()", 15000);
  });
  &lt;/script&gt;
  }
  </code></pre>
  
  <p>Controller Action:</p>
  
  <pre><code>    public ActionResult ScrollList()
      {
          return PartialView("_ScrollList", db.MyList.ToList());
      }
  </code></pre>
  
  <p>Partial View:</p>
  
  <pre><code>@model IEnumerable&lt;project.Models.MyList&gt;
  
  
  &lt;div id="firstperson"&gt;
  @*Get lastest record and display.*@
  @foreach (var donor in Model.OrderByDescending(p =&gt; p.ProcessTime).Take(1))
  {
  }
  &lt;/div&gt;
  
  &lt;div id="secondperson"&gt;
  @*Get second lastest record and display.*@
  @foreach (var donor in Model.OrderByDescending(p =&gt; p.ProcessTime).Skip(1).Take(1))
  {       
  }
  &lt;/div&gt;
  
  &lt;div id="thirdperson"&gt;
  @*Get third lastest record and display.*@
  @foreach (var donor in Model.OrderByDescending(p =&gt; p.ProcessTime).Skip(2).Take(1))
  {        
  }
  &lt;/div&gt;
  
  @section Scripts{
  &lt;script&gt;
  $("#secondperson").hide();
  $("#thirdperson").hide();
  function person() {
      $("#firstperson").delay(5000).hide(0, function () {
          $("#secondperson").fadeIn();
          $("#secondperson").delay(5000).hide(0, function () {
              $("#thirdperson").fadeIn();
              $("#thirdperson").delay(5000).hide(0, function () {
                  $("#firstperson").fadeIn();
                  person();
              });
          });
      });
  }
  &lt;/script&gt;
  }
  </code></pre>
  
  <p>Any help would be awesome and thanks in advance! </p>