title: Calling javascript function on OnSuccess callback of Ajax.actionlink?
body: <p>I am using MVC5. I am loading images from a list using Unobtrusive Ajax.ActionLink(). Here is the sample code:-</p>
  
  <pre><code>&lt;ul class="list-group list-unstyled lists"&gt;
  @foreach (var item in Model)
  {
  &lt;li&gt;
  @Ajax.ActionLink(@item.Name,
          @item.Action,
          "Home",
          new {id = @item.Id },
          new AjaxOptions
          {
              UpdateTargetId = "divImage",
              InsertionMode = InsertionMode.Replace,
              HttpMethod = "GET",
              OnSuccess = "enableZoom"
          })
  &lt;/li&gt;
  }
  &lt;/ul&gt;
  </code></pre>
  
  <p>OnSuccess callback I call a function 'enableZoom'. It works as long as it is within the script tag of the view page. But When I move enableZoom function to custom.js file, OnSuccess callback can't find or call it.</p>
  
  <pre><code>&lt;script&gt;
      function enableZoom() {
          $("#divImage").zoom({
              on: "grab",
              magnify: "1"
          });
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>PS: My custom.js file is loading successfully (confirmed through firebug) and custom.js has other functionality too and that is working. Any clue/help would be appreciated?</p>