Uncaught TypeError: Object [object Object] has no method 'dataTable'
Uncaught TypeError: Object [object Object] has no method 'dataTable'
rekabumeister
Posts: 3Questions: 0Answers: 0
Hey,
I've been trying to use datatables in an ASP.NET page but it just doesn't seem to work. My table is the following:
[code]
First Name
Suname
Email address
Phone Number
@foreach (var member in Model)
{
@member.FirstName
@member.SurName
@member.Email
@member.PhoneNumber
}
[/code]
And my javascript section looks like this:
[code]
$(document).ready(function () {
$('#searchMembers').dataTable();
});
[/code]
When I load the page I get the following error:
Uncaught TypeError: Object [object Object] has no method 'dataTable' SearchMembers:1283
(anonymous function) SearchMembers:1283
fire jquery-1.8.3.js:974
self.fireWith jquery-1.8.3.js:1084
jQuery.extend.ready jquery-1.8.3.js:406
DOMContentLoaded
After some searching I updated my jquery-ui to the latest (1.9.2) but it didn't help.
What am I doing wrong? I would so love to use datatables but I just can't get it working! Is it possible that I haven't copied some of the files or didn't copy them to the right place?
Thanks a lot in advance!
I've been trying to use datatables in an ASP.NET page but it just doesn't seem to work. My table is the following:
[code]
First Name
Suname
Email address
Phone Number
@foreach (var member in Model)
{
@member.FirstName
@member.SurName
@member.Email
@member.PhoneNumber
}
[/code]
And my javascript section looks like this:
[code]
$(document).ready(function () {
$('#searchMembers').dataTable();
});
[/code]
When I load the page I get the following error:
Uncaught TypeError: Object [object Object] has no method 'dataTable' SearchMembers:1283
(anonymous function) SearchMembers:1283
fire jquery-1.8.3.js:974
self.fireWith jquery-1.8.3.js:1084
jQuery.extend.ready jquery-1.8.3.js:406
DOMContentLoaded
After some searching I updated my jquery-ui to the latest (1.9.2) but it didn't help.
What am I doing wrong? I would so love to use datatables but I just can't get it working! Is it possible that I haven't copied some of the files or didn't copy them to the right place?
Thanks a lot in advance!
This discussion has been closed.
Replies
Steph
I tried that too, but I got the same result
Allan
At the bottom of the layout page there was this:
[code]
@Scripts.Render("~/bundles/jquery")
@RenderSection("scripts", required: false)
[/code]
These lines generated two futhe jquery inludes to the bottom of the page hence breaking things. All is solved now, thank you!