最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

jquery - 0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'autocomplete'

programmeradmin1浏览0评论

I have the following script inside my asp mvc 5 web project:-

$("input[data-autoplete-source]").each(function () {
    var target = $(this);
    target.autoplete({ source: target.attr("data-autoplete-source"), minLength: 1, delay: 1000 });

});

but i am getting the following exception :-

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'autoplete'

so can anyone advice what might be causing this error ? Thank

Edit Inside my _layout view i have the following:-

  @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
        @RenderSection("scripts", required: false)

and on the view that is raising the error i define the following:-

@section Scripts{
    @Scripts.Render("~/bundles/jqueryval")
    <script src="~/Scripts/Custome.js"></script>}

where the cusotm.js contains my above auto plete code. i have noted another problem is that i have Ajax.BeginForm on my view, but it is working as normal form , and it is not generating Ajax requests, although i am loading the ~/bundles/jqueryval ? can you adivce ?

I have the following script inside my asp mvc 5 web project:-

$("input[data-autoplete-source]").each(function () {
    var target = $(this);
    target.autoplete({ source: target.attr("data-autoplete-source"), minLength: 1, delay: 1000 });

});

but i am getting the following exception :-

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'autoplete'

so can anyone advice what might be causing this error ? Thank

Edit Inside my _layout view i have the following:-

  @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
        @RenderSection("scripts", required: false)

and on the view that is raising the error i define the following:-

@section Scripts{
    @Scripts.Render("~/bundles/jqueryval")
    <script src="~/Scripts/Custome.js"></script>}

where the cusotm.js contains my above auto plete code. i have noted another problem is that i have Ajax.BeginForm on my view, but it is working as normal form , and it is not generating Ajax requests, although i am loading the ~/bundles/jqueryval ? can you adivce ?

Share Improve this question edited Jun 20, 2014 at 0:23 John John asked Jun 19, 2014 at 23:53 John JohnJohn John 1
Add a ment  | 

1 Answer 1

Reset to default 2

If you don't have the .autoplete() method, then that is probably because you don't have the right jQuery plugins loaded that contain that method.

If you intend to be using the autoplete method from the jQuery UI set of plugins, then you need to load that library before you can use this method.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论