<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>爱周末 &#187; json.parse</title>
	<atom:link href="http://zhoumo123.cn/tag/json-parse/feed" rel="self" type="application/rss+xml" />
	<link>http://zhoumo123.cn</link>
	<description>知识分享，共同进步。zhoumo123.cn</description>
	<lastBuildDate>Thu, 07 Nov 2019 05:53:49 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0.1</generator>
	<item>
		<title>ie不支持json.parse 将json字符串转换成对象的解决方法</title>
		<link>http://zhoumo123.cn/json/2410.html</link>
		<comments>http://zhoumo123.cn/json/2410.html#comments</comments>
		<pubDate>Sat, 17 Jan 2015 03:38:18 +0000</pubDate>
		<dc:creator><![CDATA[zhangc]]></dc:creator>
				<category><![CDATA[json]]></category>
		<category><![CDATA[json.parse]]></category>

		<guid isPermaLink="false">http://zhoumo123.cn/?p=2410</guid>
		<description><![CDATA[很多IE版本不支持使用json.parse将json字符串转换成对象，可以使用eval来解决。 示例： 以下示例使用 JSON.parse 将 JSON 字符串转换成对象。 var jsontext = &#8216;{&#8220;firstname&#8221;:&#8221;Jesper&#8221;,&#8221;surname&#8221;:&#8221;Aaberg&#8221;,&#8221;phone&#8221;:[&#8220;555-0100&#8243;,&#8221;555-0120&#8243;]}'; var contact = JSON.parse(jsonte ...  <a href="http://zhoumo123.cn/json/2410.html">  阅读全文 </a>]]></description>
				<content:encoded><![CDATA[<p>很多IE版本不支持使用json.parse将json字符串转换成对象，可以使用eval来解决。</p>
<p><strong>示例：</strong><br />
以下示例使用 JSON.parse 将 JSON 字符串转换成对象。<br />
var jsontext = &#8216;{&#8220;firstname&#8221;:&#8221;Jesper&#8221;,&#8221;surname&#8221;:&#8221;Aaberg&#8221;,&#8221;phone&#8221;:[&#8220;555-0100&#8243;,&#8221;555-0120&#8243;]}';<br />
var contact = JSON.parse(jsontext);</p>
<p><strong>将上面示例中的代码：</strong></p>
<p>var jsontext = &#8216;{&#8220;firstname&#8221;:&#8221;Jesper&#8221;,&#8221;surname&#8221;:&#8221;Aaberg&#8221;,&#8221;phone&#8221;:[&#8220;555-0100&#8243;,&#8221;555-0120&#8243;]}';<br />
var contact = JSON.parse(jsontext);</p>
<p><strong>替换为：</strong></p>
<p>var contact = eval(&#8220;[&#8221; + jsontext + &#8220;]&#8221;)[0];<br />
或者<br />
var contact = eval(&#8220;(&#8221; + jsontext + &#8220;)&#8221;);</p>
<p><strong>json.parse IE浏览器支持：</strong></p>
<p>json.parse在以下文档模式中受到支持：Internet Explorer 8 标准模式、Internet Explorer 9 标准模式、Internet Explorer 10 标准模式、Internet Explorer 11 标准模式。此外，也在应用商店应用（Windows 8 和 Windows Phone 8.1）中受支持。</p>
<p>json.parse在以下文档模式中不受支持：Quirks、Internet Explorer 6 标准模式、Internet Explorer 7 标准模式。</p>
]]></content:encoded>
			<wfw:commentRss>http://zhoumo123.cn/json/2410.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
