JSON formatting error if vbCrLf present in passed string data?

JSON formatting error if vbCrLf present in passed string data?

rowelrowel Posts: 11Questions: 0Answers: 0
edited November 2013 in General
Using AJAX to pull data from an SQL server.
I get a JSON formatting error if there are any hidden vbCrLf (Carriage Return/Line Feed) codes in the passed string data.

For now, I resorted to filtering these invisible characters out and replacing them with spaces.

Is this due to the nature of the JSON format? no embedded carriage returns allowed inside the string?

Replies

  • rowelrowel Posts: 11Questions: 0Answers: 0
    vbTabs (invisible Tab) in string also causes a JSON error.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Correct - that's part of JSON. It is jQuery which validates the JSON, not DataTables - I just call $.parseJSON .

    Allan
  • rowelrowel Posts: 11Questions: 0Answers: 0
    Thanks Allan.
This discussion has been closed.