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

I have the following script inside my asp mvc 5 web project:-$("input[data-autoplete-source]"

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745416983a4626793.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信