Reputation: 846
I am trying to integrate datatables jQuery plugin into my table generated through PHP.
The table layout and everything looks fine with search and sorting options but when clicking on any sorting options in table headers I am facing this error
Uncaught TypeError: a.charAt is not a function
Did anyone face this problem before? Any help would be appreciated.
Upvotes: 2
Views: 5419
Reputation: 955
This issue existed (at least) on Datatables 1.10.5, but no longer on 1.10.16, so it has been since fixed.
Upvotes: 4
Reputation: 147
Datatable bug connected with changes in empty string processing by map function. Fixed in some code I saw.
Quick fix in my case was to replace match(/"[^"]+"|[^ ]+/g)||''
with match(/"[^"]+"|[^ ]+/g)||['']
(empty value as array) in datatable code.
Upvotes: 7
Reputation: 59
It's because either you have multiple jQuery loaded in the same page or you are loading datatable before loading jQuery.
To resolve the issue:
Upvotes: 0