title: JQuery After Body ASP .NET MVC 4
body: <p>I just created an ASP .NET MVC 4 WebAPI project.</p>
  
  <p>In looking at the default _Layout.cshtml, I see that the jquery script is being inserted after the body is rendered (not in the head).</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;meta name="viewport" content="width=device-width" /&gt;
      &lt;title&gt;@ViewBag.Title&lt;/title&gt;
      @Styles.Render("~/Content/themes/base/css", "~/Content/css")
      @Scripts.Render("~/bundles/modernizr")
  &lt;/head&gt;
  &lt;body&gt;
      @RenderBody()
  
      @Scripts.Render("~/bundles/jquery")
      @RenderSection("scripts", required: false)
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This causes the error </p>
  
  <pre><code>$ is not defined 
  </code></pre>
  
  <p>of course, trying to write </p>
  
  <pre><code>$(document).ready(function() {...}).
  </code></pre>
  
  <p>Moving the </p>
  
  <pre><code>@Scripts.Render("~/bundles/jquery")
  </code></pre>
  
  <p>into the head section of the _Layout.cshtml corrects the problem and jquery works as expected.</p>
  
  <p>What's up? Am I doing something wrong and there's a reason for the default location of the Script.Render inside _Layout.cshtml?</p>