title: Setting ajax url for jQuery in JS file using ASP.NET MVC
body: <p>When doing a Ajax call to an MVC action currently I have my javascript inside the View, not inside its own JS file.</p>
  
  <p>It is then very easy to do this:</p>
  
  <pre><code>var xhr = $.ajax({
       url: '&lt;%= Url.Action("DisplayItem","Home") %&gt;/' + el1.siblings("input:hidden").val(),
       data: { ajax: "Y" },
       cache: false,
       success: function(response) { displayMore(response, el1, xhr) }
  });
  </code></pre>
  
  <p>...then including the URL in the ajax call using <code>Url.Action()</code> inside the JS is pretty easy. How could i move this do its own JS file when without hard coding the URL?</p>