X
點擊此處開啟此網站的行動版。

技術支援討論區

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

已張貼

Remove the escape string in the return string.

Remove the escape string in the return string.
附加的畫面擷圖

由 httpsOmkar 於 修改

引用

額外的系統細節

已安裝的外掛程式

  • Shockwave Flash 32.0 r0

應用程式

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

更多資訊

cor-el
  • Top 10 Contributor
  • Moderator
17212 個解決方法 155506 個答案

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>
這篇文章有幫助嗎?
引用
問個問題

如果您還沒有帳號,您必須先 登入您的帳號 來回覆文章。請 開始一個新問題