unable to parse json string using java script eval function

Vic*_*cky 5 javascript jquery json

I am facing issue with the following Json reponse object in the javascript eval function;Getting java script error expected } because of special characters Tamás and Török

{
  [{
    "userFirstNm": "Naresh",
    "userAsscId": "70336",
    "userLastNm": "Yashwantrao",
    "userLanId": "a70336"
  }, {
    "userFirstNm": "Tamás",
    "userAsscId": "37732",
    "userLastNm": "Török",
    "userLanId": "a37732"
  }]
}
Run Code Online (Sandbox Code Playgroud)

Is there is any solution to resolve this problem.

替代文字 替代文字

Cha*_*ion 4

啊我知道问题是什么了。您需要将对象表达式括在括号中才能eval正常工作。

\n\n
alert(eval("({\\"userFirstNm\\":\\"Tam\xc3\xa1s\\",\\"userAsscId\\":\\"37732\\",\\"userLastNm\\":\\"T\xc3\xb6r\xc3\xb6k\\",\\"userLanId\\":\\"a37732\\"})"));\n
Run Code Online (Sandbox Code Playgroud)\n