2016年3月29日火曜日

IEでJSONデータが正常に取得できないケース

InternetExplorerでJSONのエラーが出たら-ITかあさん
http://www.kaasan.info/archives/1612


IE11でJSONを利用できません。 - Microsoft
https://social.technet.microsoft.com/Forums/ie/ja-JP/990ea9f8-7887-4455-a8d1-b9c3e00a2c29/ie11json?forum=internetexplorerja
http://stackoverflow.com/questions/20577007/filereader-and-json-objects-not-defined-in-ie11
==========================================
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
==========================================


IE+Jsonではまった - とりあえず暇だったし何となく始めたブログ
http://d.hatena.ne.jp/khiker/20081026/javascript_json
==========================================
次のようなものを.htaccessに足したらちゃんと動いた.
AddCharset utf-8 json
AddType text/javascript json
==========================================


1.json2.jsのススメ - motohasi.net
http://www.motohasi.net/Program/JavaScript/Item1.php

GitHub - douglascrockford/JSON-js: JSON in JavaScript
https://github.com/douglascrockford/JSON-js


JSON記述の基本とデコード( json2.js )
http://logic.moo.jp/data/archives/535.html
============================================
// 古いやり方 var json_object = eval('(' + json_text + ')');
var json_object = JSON.parse( json_text );


json2.jsで解決。


ただし、jQueryなどを使っている場合は、別の解決策の方がよいかも。