X
Tap here to go to the mobile version of the site.

Support Forum

Remove the escaping of string while JSON.decode calling in developers toolbar.

Posted

Remove the escape string in the return string.

Remove the escape string in the return string.
Attached screenshots

Modified by httpsOmkar

Quote

Additional System Details

Installed Plug-ins

  • Shockwave Flash 32.0 r0

Application

  • User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0

More Information

cor-el
  • Top 10 Contributor
  • Moderator
17000 solutions 153507 answers

That is not possible in this case because the result shown in the Web Console is enclosed in quotation marks and quotes (") in the string need to be escaped. You would have to use a method that doesn't enclose like a prompt or alert to be able to see an unescaped string. When specifying the string you can use single quotes to avoid having to escape the quotes.

alert(JSON.stringify(JSON.parse('{"test":"test"}')));
alert(JSON.stringify(JSON.parse("{\"test\":\"test\"}")));
That is not possible in this case because the result shown in the Web Console is enclosed in quotation marks and quotes (") in the string need to be escaped. You would have to use a method that doesn't enclose like a prompt or alert to be able to see an unescaped string. When specifying the string you can use single quotes to avoid having to escape the quotes. <pre><nowiki> alert(JSON.stringify(JSON.parse('{"test":"test"}'))); alert(JSON.stringify(JSON.parse("{\"test\":\"test\"}"))); </nowiki></pre>
Was this helpful to you?
Quote
Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.