sType:html - Issue with \r \n ?
sType:html - Issue with \r \n ?
Christian Bonato
Posts: 18Questions: 0Answers: 0
Hi Allan,
Invisible chars in a html string passed to a row break everything.
Since I often need to put large chunks of html into aaData, would it be possible to have a function that pre-processes the html string and get rid of all invisible chars so that it remains human-readable ?
This breaks JQuery :
[code]
"
..."
[/code]
This does not :
[code]
"..."
[/code]
Invisible chars in a html string passed to a row break everything.
Since I often need to put large chunks of html into aaData, would it be possible to have a function that pre-processes the html string and get rid of all invisible chars so that it remains human-readable ?
This breaks JQuery :
[code]
"
..."
[/code]
This does not :
[code]
"..."
[/code]
This discussion has been closed.
Replies
[code]
var a = "
whatever
";
[/code]
Allan
You're right about multi-line strings aren't really supported in Javascript.
I inject a lot of HTML in my table's td's, so the html is really hard to wrok with without line breaks.
I ended up creating a big php string var, with lone breaks for code readability, and then clean it before passing it in aaData with :
[code]
$str = str_replace(CHR(10),"",$str);
$str = str_replace(CHR(13),"",$str);
$str = str_replace(CHR(9),"",$str);
[/code]