S
S
Savely2020-12-06 01:28:50
JavaScript
Savely, 2020-12-06 01:28:50

How to remove json special characters?

Hello!
Javascript gets like this

[{
    "amount": "-0.77",
    "comment": "efc_''". |  \  ||  |  ? ///", "date": "Sat, 05 Dec 2020 22:23:26 GMT", "rating": 3, "status": "PAID", "trxn_type": "Комиссия", "type": "commission"}]


And trying to parse in JSON.parse(data_src.toString('utf8')); , but crashes with Uncaught SyntaxError: Unexpected token . in JSON at position 40

How do I validate JSON on the client side?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question