title: Not sure where to place Scripts.Render for JQuery
body: <p>I'm receiving a '<strong><em>Uncaught TypeError: undefined is not a function</em></strong>' while trying to call the autocomplete function in JQuery and I'm assuming I have my Scripts.Render in the wrong place. Where shouldthe JQuery scripts go within the layout.cshtml? My assumption was at the top but I can't seem to get it working no matter where I put them.</p>
  
  <p>Here is the top of my layout file:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;title&gt;@ViewBag.Title - My ASP.NET Application&lt;/title&gt;
      @Scripts.Render("~/bundles/jquery")
      @Scripts.Render("~/bundles/jqueryui")
      @Styles.Render("~/Content/css")
      @Scripts.Render("~/bundles/modernizr")
      @Styles.Render("~/Content/themes/base/css")
  &lt;/head&gt;...
  </code></pre>
  
  <p>and at the bottom I have this:</p>
  
  <pre><code>...
      @Scripts.Render("~/bundles/modernizr")
      @Scripts.Render("~/bundles/bootstrap")
      @RenderSection("scripts", required: false)
  &lt;/body&gt;
  </code></pre>
  
  <p>At the bottom of my View file I have the javascript:</p>
  
  <pre><code>@section scripts{
      &lt;script&gt;
      $(document).ready(function () {
  
          $('#mpvalue').autocomplete({
              source: '@Url.Action("MyMethod")'
          });
  
      });
      &lt;/script&gt;
  }
  </code></pre>
  
  <p>I also have some bundling going on in the BundleConfig:</p>
  
  <pre><code>    bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                  "~/Scripts/jquery-{version}.js"));
  
      bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                  "~/Scripts/jquery.validate*"));
  
      bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                    "~/Content/themes/base/jquery.ui.core.css",
                    "~/Content/themes/base/jquery.ui.resizable.css",
                    "~/Content/themes/base/jquery.ui.selectable.css",
                    "~/Content/themes/base/jquery.ui.accordion.css",
                    "~/Content/themes/base/jquery.ui.autocomplete.css",
                    "~/Content/themes/base/jquery.ui.button.css",
                    "~/Content/themes/base/jquery.ui.dialog.css",
                    "~/Content/themes/base/jquery.ui.slider.css",
                    "~/Content/themes/base/jquery.ui.tabs.css",
                    "~/Content/themes/base/jquery.ui.datepicker.css",
                    "~/Content/themes/base/jquery.ui.progressbar.css",
                    "~/Content/themes/base/jquery.ui.theme.css"));
      // Use the development version of Modernizr to develop with and learn from. Then, when you're
      // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
      bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                  "~/Scripts/modernizr-*"));
  
      bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                "~/Scripts/bootstrap.js",
                "~/Scripts/respond.js"));
  
      bundles.Add(new StyleBundle("~/Content/css").Include(
                "~/Content/bootstrap.css",
                "~/Content/site.css"));
  </code></pre>
  
  <p>From what I've read on other posts and examples on the web, everything appears to be in the correct places. </p>
  
  <p>What am I doing to throw the '<strong><em>Uncaught TypeError: undefined is not a function</em></strong>'?</p>
  
  <p>Any help would be appreciated</p>
  
  <p>Thanks!</p>
  
  <p>EDIT: This is running on ASP.NET MVC 5</p>