简体   繁体   中英

JavaScript Error In View - Loading Order

I have an Index page that loads a script within a Razor @section Scripts

I am getting an error on load at

Uncaught TypeError: undefined is not a function

Here is my script. It is throwing the error at "$("input#autocomplete").autocomplete({"

@section scripts
{
<script type="text/javascript">
    var items;
    $(document).ready(function() {
        $("input#autocomplete").autocomplete({
            source: function(request, response) {
                $.ajax({....

My question is, does this have anything to do with the where the script section is placed in the view? (it is after the table with the autocomplete input). The layout I am using does include the following in the head:

@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")

It seems that you dont have the autocomplete plugin.

Download it from this link .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM