There is such an object:
var data = '{ \ "obj": [ \ { "id": 1, "coord": [53.831235, 27.175426], "country": "<div class=\"nameClass\"><\/div>", "city": "ΠΠΎΡΠΊΠ²Π°", "address": "ΡΠ»ΠΈΡΠ° ΠΠΎΠ²ΠΆΠ΅Π½ΠΊΠΎ, 1Ρ1" },\ { "id": 2, "coord": [53.918879, 27.906016], "country": "Π ΠΎΡΡΠΈΡ", "city": "ΠΠΎΡΠΊΠ²Π°", "address": "ΡΠ»ΠΈΡΠ° ΠΠΎΠ²ΠΆΠ΅Π½ΠΊΠΎ, 2" }\ ]\ }'; After translate in json data = JSON.parse(data);
But it gives an error:
Unexpected token <in JSON
. How to add a layout with classes to an object so that json does not swear?
ΠΏΡΠΎΠ±Π»Π΅ΠΌΠ° Π½Π΅ ΠΊΠ»Π°ΡΡΠ°Ρ Π²Π΅ΡΡΡΠΊΠΈagainΠΏΡΠΎΠ±Π»Π΅ΠΌΠ° Π½Π΅ ΠΊΠ»Π°ΡΡΠ°Ρ Π²Π΅ΡΡΡΠΊΠΈand not in slashes around classes ..... you have 5 slashes in completely different, totally incomprehensible places .......ΡΠ»ΡΡΠΈ ΠΊΠΎΡΠΎΡΡΠ΅ Π² ΠΊΠΎΠ½ΡΠ΅ ΡΡΡΠΎΠΊΠΈ ΡΡΠΎ ΡΡΠΎΠ± ΠΌΠΎΠΆΠ½ΠΎ Π±ΡΠ»ΠΎ ΠΏΠΈΡΠ°ΡΡ Π½Π° Π½ΠΎΠ²ΠΎΠΉ ΡΡΡΠΎΠΊΠ΅- for this purpose, concatenation signs were invented - Alexey Shimansky