<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; JS: Двойные кавычки в JSON]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15046&amp;type=atom" />
	<updated>2019-11-01T16:51:22Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15046</id>
		<entry>
			<title type="html"><![CDATA[Re: JS: Двойные кавычки в JSON]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136504#p136504" />
			<content type="html"><![CDATA[<p>Если текст буквально такой {&quot;World&quot; : &quot;Hello \&quot;Test&quot;}, проблем с JSON.parse быть не должно.<br />При записи в коде он должен выглядеть с двойным обратным слешем.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-11-01T16:51:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136504#p136504</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JS: Двойные кавычки в JSON]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136503#p136503" />
			<content type="html"><![CDATA[<p>Совет отличный. НО! Я не знаю как.<br /></p><div class="codebox"><pre><code>
[1] s = &#039;{&quot;name&quot; : &quot;Hello \&quot;Test&quot;}&#039;;
[2] s = s.replace ???????
[3] json = JSON.parse(s);
[4] console.log(json.name)</code></pre></div><p>Не могу справиться со второй строкой.</p>]]></content>
			<author>
				<name><![CDATA[DnsIs]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26282</uri>
			</author>
			<updated>2019-11-01T15:47:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136503#p136503</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JS: Двойные кавычки в JSON]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136502#p136502" />
			<content type="html"><![CDATA[<p>Замените одинарный обратный слеш на двойной.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-11-01T15:35:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136502#p136502</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[JS: Двойные кавычки в JSON]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136500#p136500" />
			<content type="html"><![CDATA[<p>Доброго дня.</p><p>Некий сайт при отправке XMLHttpRequest не возвращает responseJSON, а responseText такой вот:</p><p><strong>{&quot;World&quot; : &quot;Hello \&quot;Test&quot;}</strong></p><p>Как видите, проблема в кавычках. Само собой JSON.parse не работает.</p><p>javascript меня удивил<br /></p><div class="codebox"><pre><code>var j = &#039;{&quot;World&quot; : &quot;Hello &quot;Test&quot;}&#039;;
var k = &#039;{&quot;World&quot; : &quot;Hello \&quot;Test&quot;}&#039;;
console.log((j == k));
--&gt; true
</code></pre></div><p>Как победить?</p>]]></content>
			<author>
				<name><![CDATA[DnsIs]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26282</uri>
			</author>
			<updated>2019-11-01T10:46:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136500#p136500</id>
		</entry>
</feed>
