title: Issue while ajax request in MVC5
body: <p>I'm facing a very strange issue while applying ajax request in my mvc5 project. Here is my code in Index.cshtml:</p>
  
  <pre><code>  $(document).ready(function () {
   for (var i = 0; i &lt; 3; i++) {
          $.ajax({
              type: "GET",
              url: "Home/LoadTodayStories",
              data: { pageIndex: blockNumber, pageSize: 8, index: i }, 
              dataType: 'html',
              async: false,
              beforeSend: function () { $("#loadingDiv").show(); },
              complete: function () { $('#loadingDiv').hide(); },
              success: function (data) {
                  $('.today-spl').append(data);
              },
              error: function (e) { alert(e.responseText); }
          });
      }
  });
  </code></pre>
  
  <p>this code works perfectly when I just run my project and there is no whole url including the controller name and action method. In other words if the url is just "<a href="http://localhost:52572/" rel="nofollow">http://localhost:52572/</a>" the code works, however when I include controller name and action method such as "<a href="http://localhost:52572/Home/Index" rel="nofollow">http://localhost:52572/Home/Index</a>" I got error saying: </p>
  
  <blockquote>
    <p>The resource cannot be found.
    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. </p>
    
    <p>Requested URL: /Home/Home/LoadTodayStories</p>
  </blockquote>
  
  <p>P.S. I know what the error is and I need to change my ajax request url part from </p>
  
  <pre><code>url: "Home/LoadTodayStories",
  </code></pre>
  
  <p>to</p>
  
  <pre><code> url: "LoadTodayStories",
  </code></pre>
  
  <p>But after changing this part, the code starts working with url "<a href="http://localhost:52572/Home/Index" rel="nofollow">http://localhost:52572/Home/Index</a>" and does not work with "<a href="http://localhost:52572/" rel="nofollow">http://localhost:52572/</a>". Does anyone have idea how to get this work with both the conditions?</p>
  
  <p>My RouteConfig.cs:</p>
  
  <pre><code> routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapRoute(
              name: "Default",
              url: "{controller}/{action}/{id}",
              defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
          );
  </code></pre>