我的字符串是
"\"{'Body': '<p>I have a issue : When I add a content that includes text and hyperlink, after that I use the wrapLongStringIntoMultiLine to set length of each lines. But in the special case, the end of line is in scope of hyperlink, so the hyperlink structure is broken. \\r\\r\\nHere is my code :</p>\\r\\r\\n\\r\\r\\n<pre><code>String languages=\"\" Deutsch, English (All), English (United Kingdom), Bahasa Indonesia, Italiano <a href=\\\\\"\"\\\\\"\"> edit</a>\"\";\\r\\r\\n</code></pre>\\r\\r\\n\\r\\r\\n<p>after call wrapLongStringIntoMultiLine: </p>\\r\\r\\n\\r\\r\\n<pre><code><html>Deutsch, English (All), English (United Kingdom),</br> Bahasa Indonesia, Italiano <a href<br>=\\\\\"\"\\\\\"\"> edit</a>\"\";\\r\\r\\n</code></pre>\\r\\r\\n\\r\\r\\n<p>The <code><br> tag</code> exists in the scope of hyperlink. How to fix this issue? Please give me advise. Thanks</p>\\r\\r\\n', 'Title': 'Use the wrapLongStringIntoMultiLine on the Jeditor pane'}\"\r"
我已经使用JSON LINt验证了字符串,并将其显示为有效的JSON。
SyntaxError: JSON.parse: unexpected non-whitespace character afterJSON data at line 1 column 338 of the JSON data
当我使用$ .parseJSON(str)
时,这是我得到的错误答案 0 :(得分:0)
根据我的观察,我发现,有&#34; :&#34;在你的字符串中,所以 json 无法理解那个特定的东西,让我们在你的字符串中说,
I have a issue : When I add a content...
所以我建议你试试&#34; - &#34;而不是&#34; :&#34;
例如,
I have a issue - When I add a content...