title: ASP.NET MVC 5 Ajax controller call not working after publish
body: <p>I have been working on an ASP.NET MVC 5 web application which includes a view that contains a Raphael javascript image that is using AJAX calls to controller method to get some data on the initial render. When I render the page locally on my own machine, everything executes as expected and the page loads fine. However, when I 'Publish' the application to a test server, the AJAX call hits the 'Error' function every time I try to load the page.</p>
  
  <p>After some research I was able to resolve some of the javascript errors by adding this tag to the layout page:</p>
  
  <pre><code>&lt;meta http-equiv="X-UA-Compatible" content="IE=Edge"&gt;
  </code></pre>
  
  <p>However, it still does not work any time I try to use Ajax to make a call to a controller method. When I take a look at the issue with firebug i see the error that is being thrown is "Boostrap requires JQuery". I have searched the error and have ensured that the script tags are in the correct order- JQuery is being called before Boostrap:</p>
  
  <pre><code>&lt;script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.10.2.min.js")"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="@Url.Content("~/Scripts/boostrap.min.js")"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="@Url.Content("~/Scripts/raphael.js")"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="@Url.Content("~/Scripts/update.js")"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>I have also checked the permissions on the files and they both have the same, correct privs which has left me stuck. These controller calls work exactly as expected when I run the application locally on my machine, but error once I have published the application to a server.</p>
  
  <p>I am not sure what else could be causing this issue. Any and all advice would be greatly appreciated!!!</p>
  
  <p>Below is one of the JQuery call to the controller method:</p>
  
  <pre><code>function GetESN(area, ID) {
  $.ajax({
      url: "/Home/GetESN",
      type: 'POST',
      async: false,
      dataType: 'json',
      cache: false,
      data: { area: area, ID: ID },
      success: function (data) {
          esn = data
      },
      error: function () {
          alert('error occurred');
      }
  });
  </code></pre>
  
  <p>}</p>
  
  <p>Please let me know if there any more information that is required.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>The issue actually fell in the way the site was named- it needed to be formatted as "<a href="http://projectname.com/location" rel="nofollow">http://projectname.com/location</a>". I ended up having to split the pathname to account for the "/location" bit and built the URL right at the beginning of the script. Probably not an ideal situation but it works well for my situation. </p>