Reputation: 1362
I am working in ASP .NET MVC4. When jquery is loaded then I got an error Undefined is not a function
by using jquery.
In HTML version its working correctly but when it loaded through compiler it is not working correctly.
Upvotes: 3
Views: 11110
Reputation: 1831
Well if you are using AMD pattern, you would need to keep your module name to "datatables" so that you don't get "Uncaught TypeError: jQuery(...).DataTable is not a function"
Below link was helpful. https://datatables.net/forums/discussion/21178/amd-definition-without-explicit-module-name
Upvotes: 0
Reputation: 330
I think the problem is constructor DataTable()
, It is supposed to be capitalized.
Instead of $('#dt_inbox').dataTable()
use $('#dt_inbox').DataTable()
Upvotes: 1
Reputation: 1108
I was struggling with the same problem for hours.. My issue was resolved when I changed the $
to jQuery
in my code.
Upvotes: 0
Reputation: 1362
Sorry I am answering my own question I got error for this question it is just rearranging file sequence in file loading Thanks to all who give me time to solve my problem
Upvotes: 3
Reputation: 1724
You problably forgot to add the plugin to your bundle. The following questions goes into more details:
Usage of the ASP.NET MVC4 jquery/javascript bundles
Upvotes: 0