<?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>json | ユガラボ</title>
	<atom:link href="https://yugalab.net/archives/tag/json/feed" rel="self" type="application/rss+xml" />
	<link>https://yugalab.net</link>
	<description>pursue the beauty with yuga lab.</description>
	<lastBuildDate>Wed, 12 Nov 2014 02:53:03 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.7.7</generator>
	<item>
		<title>【備忘録】文法を間違えていないのに、jsonファイルがうまく取得できない</title>
		<link>https://yugalab.net/archives/67</link>
		
		<dc:creator><![CDATA[ユーリ]]></dc:creator>
		<pubDate>Fri, 31 Oct 2014 03:47:32 +0000</pubDate>
				<category><![CDATA[technical]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[json]]></category>
		<guid isPermaLink="false">http://yugalab.net/?p=67</guid>

					<description><![CDATA[<p>こんにちは、ユーリです。 先日、お仕事でjsonファイルを取得してデータを表示する機構を作っていたときのこと。 テキストエディタで文法も間違いなく、jsonファイルを作成しました。 しかし、javascriptからアクセ [&#8230;]</p>
<p>The post <a href="https://yugalab.net/archives/67">【備忘録】文法を間違えていないのに、jsonファイルがうまく取得できない</a> first appeared on <a href="https://yugalab.net">ユガラボ</a>.</p>]]></description>
										<content:encoded><![CDATA[<span id="more-67"></span>
こんにちは、ユーリです。<br/>
<br/>
先日、お仕事でjsonファイルを取得してデータを表示する機構を作っていたときのこと。<br/>
テキストエディタで文法も間違いなく、jsonファイルを作成しました。<br/>
<br/>
しかし、javascriptからアクセスしようとしても、うまく読めない。<br/>
<br/>
結論から言いますと、jsonファイルに「BOM」が含まれていたからでした。<br/>
<br/>
※BOM(Byte Order Mark)<br/>
ファイルの先頭にこっそり挿入されている識別子で、<br/>
そのファイルの形式を表すデータです。<br/>
<br/>
これが、データを読み出す際に不純物として処理され、エラーが発生したようです。<br/>
ほかにも、改行コードが悪さをすることもあるようです。<br/>
<br/>
テキストエディタでjsonファイルを再度開き、「BOMなし」の保存をして再アップロードしたところ、<br/>
無事、jsonファイルを読み出すことができました！<br/>
<br/>
めでたしめでたし。<p>The post <a href="https://yugalab.net/archives/67">【備忘録】文法を間違えていないのに、jsonファイルがうまく取得できない</a> first appeared on <a href="https://yugalab.net">ユガラボ</a>.</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
