0

I'm trying to load a json file dynamically. It's 2MB zipped. When I look at it through most browsers (including IE) at radioladio.com/data/1.json, the json file is automatically unzipped and displayed as the expected text. However, when I try to load it and read it dynamically (radioladio.com/radioplayer) in IE, it says there is an invalid character. I have a feeling this may be something to do with encoding but I'm not too knowledgeable about this sort of thing. It seems IE may think that it is HTML not json?

4

1 回答 1

0

尝试使用 jQuery 的$.get,指定dataType: "json"或使用速记:$.getJSON。我认为您并没有具体说它是一种json数据类型,因此 IE 采用默认的 html。我可能错了,让我知道这是否有效!

于 2013-08-27T11:21:20.940 回答