I have a project that works fine on my local machine, but it doesnβt work after deploying it to the server. If I set breakpoints in javascript, it hit them and went through the code, but does not do what it should (jquery autocomplete). I even made sure that the script files that I need are stored on the server. Is there anything I'm looking at?
Code to run:
<script type="text/javascript"> $(document).ready(function () { $("input.autocomplete").autocomplete({ appendTo: '.container', source: function (request, response) { $.ajax({ url: '/Home/GetUsers', type: "POST", dataType: "json", data: { query: request.term }, success: function (data) { response($.map(data, function (item) { return { label: item, value: item }; })); } }); } }); }) </script>
_Layout.cshtml where jquery is included:
@Styles.Render("~/Content/css") @Styles.Render("~/Content/themes/base/jquery-ui.css") @Styles.Render("~/Content/themes/base/jquery-ui.autocomplete.css") @Scripts.Render("~/bundles/modernizr") <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.min.js")"></script> <script type="text/javascript" src="@Url.Content("~/Scripts/jquery-ui-1.8.20.js")"></script>
source share