Error: object doesn't support 'autocomplete'

0

I have this function using the jquery autocomplete widget, that I am getting the following error:0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'autocomplete' On my html page, in the head section I have included the following tags.

<script src="Scripts/jquery-1.10.2.min.js"></script>
<script src="Scripts/jquery-ui-1.11.4.min.js"></script>

The function is called by a variety of option button calls to do several different query's. I have this function in a different application that works well but here it is not.

function AutoComplete(Type) {
//create AutoComplete UI component
$("#txtCriteria").autocomplete({
    source: function (request, response) {
        $.ajax({
            autoFocus: true,
            async: false,
            delay: 250,
            url: "wsReports.asmx/AutoComplete",
            data: "{'Type':'" + Type + "', 'filter':'" + request.term + "'}",
            dataType: "json",
            type: "POST",
            contentType: "application/json; charset=utf-8",
            dataFilter: function (data) { return data; },
            success: function (data) {
                response($.map(data.d, function (item) {
                    return {
                        label: item.ACName,
                        value: item.ACCode
                    }   // end of return
                }))    // end of response
            }   // end of success
        });      // end of ajax
    },    // end of source
    select: function (event, ui) {
        if (ui.item.value == "") {
            alert("nothing to select");
        }
        else {
            // prevent autocomplete from updating the textbox
            event.preventDefault();
            // manually update the textbox and hidden field
            $(this).val(ui.item.label);
        }
    }, // end of select
    change: function (event, ui) {
        if (!ui.item) {
            $(event.target).val('');
        }
    },
})    // end of txtCriteria.autocomplete

}   // end of AutoComplete

Any ideas why it is not recognized in the above situation?

javascript
jquery
jquery-ui-autocomplete
asked on Stack Overflow May 18, 2016 by Tom S • edited May 18, 2016 by Uzbekjon

1 Answer

0

My fault. The jquery.js and bootstrap were loading after the jquery-ui.

answered on Stack Overflow May 19, 2016 by Tom S

User contributions licensed under CC BY-SA 3.0