Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jQuery.getJSON在IE中不使用特殊字符_Javascript_Jquery_Json_Internet Explorer - Fatal编程技术网

Javascript jQuery.getJSON在IE中不使用特殊字符

Javascript jQuery.getJSON在IE中不使用特殊字符,javascript,jquery,json,internet-explorer,Javascript,Jquery,Json,Internet Explorer,我试图调用jQuery.getJSON,但它没有在Internet Explorer中返回任何数据。下面的代码适用于所有浏览器,并返回除IE以外的数据 jQuery.getJSON("/samplejsonfile.json",function(data){ console.log('inside'); //For IE the control never reaches here camData = data; }) json文件具有特殊的unicode字符,这就是getJSON方法无法在

我试图调用jQuery.getJSON,但它没有在Internet Explorer中返回任何数据。下面的代码适用于所有浏览器,并返回除IE以外的数据

jQuery.getJSON("/samplejsonfile.json",function(data){
console.log('inside');  //For IE the control never reaches here
camData = data;
})
json文件具有特殊的unicode字符,这就是getJSON方法无法在IE中工作的原因。下面是我的示例json文件:

{"id":74112,"title":"Flø","cameratype":"0"}

有什么方法可以让这一切正常工作并让IE正确返回数据吗?

尝试改用ajax。它帮助我解决了类似的问题。我在某个地方读到过getJSON倾向于在IE中缓存数据。

什么版本的IE?说这在IE8中不起作用,但应该在IE9中起作用。版本是IE11。Edge中不存在此问题。这是否有帮助:Javascript控制台中是否存在任何错误?是的,error函数返回以下错误。这个错误是因为json中的特殊字符:{description:“Expected'}',message:“Expected'}',name:“SyntaxError”,number:-2146827279,stack:“SyntaxError…”