autocomplete “is not a function”

前端 未结 5 1404
攒了一身酷
攒了一身酷 2021-02-19 06:45

We\'ve tested the Jquery UI (jquery-ui-1.8.10.custom.min.js) Autocomplete function in a simple HTML page which worked.

We then copy the same code into an Asp.net User C

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-19 06:58

    That error usually means that jquery or the plugin hasn't yet been loaded. Check that you're function call isn't getting hit before the document is loaded:

    $(function(){
        var $searchBox = $('#mysearchBox');
        $searchBox.autocomplete(...);
    });
    

    Also check that the path to the javascript files are correct. Firebug or google chrome developer tools are useful for checking both of these issues.

提交回复
热议问题