fnAddData and single quotes

fnAddData and single quotes

jriverajrivera Posts: 14Questions: 0Answers: 0
edited February 2010 in General
Strangely, this only occurs in Firefox but not IE.
When I use fnAddData to add a row with info from a form, it fails if the value has a single quote in it.

.replace(/\'/g, "'") does not help
.replace(/\'/g,'\\\'') does not help and just results in the backslash displaying in the new row in IE.

Replies

  • jriverajrivera Posts: 14Questions: 0Answers: 0
    Actually seems to be an error with my statement right before, which in the problem case, includes a value with a backslashed single quote wrapped in double quotes. Strange that it works in IE though.
    jsonSelect = JSON.parse( selectstmt );
This discussion has been closed.