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 11 Answer
Reset to default 2If 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.