DataTables not working if the table content has special characters.

DataTables not working if the table content has special characters.

jQuery_userjQuery_user Posts: 27Questions: 0Answers: 0
edited October 2010 in General
Hello,

I am working on table row_details.

DataTables is not working whenever the content has special characters like , " # etc..

How to fix this?

I tried to replace these special charaters using \ by writing the following code:
[code]
function escapeString(s) {
var eChars = ["\\", "'", '"', ',', '#', '-'];
var lasti = eChars.length;
for (var i = 0; i < lasti; i++) {
var sArray = s.split(eChars[i]);
var lastj = sArray.length;
s = '';
for (var j = 0; j < lastj; j++) {
s += sArray[j] + '\\' + eChars[i];
}
}
var last = s.length - 2*eChars.length;
return s.substring(0, last);
}[/code]

Still I have same problem...

Does anybody have a solution for this...
Thanks

Replies

  • jQuery_userjQuery_user Posts: 27Questions: 0Answers: 0
    Solved this by using java replaceAll, before I read the array in javascript.
This discussion has been closed.