JSON.parse()
не работает с данными, возвращенными с любого URL, но eval()
работает с обоими.
var a = eval({suggestion:[{query:"Texas, USA",interpretation:{term:[{start:0,end:5,feature_type:"",matched:1,target:1,term_start:0,term_end:4},{start:7,end:10,feature_type:""}]},operation:2,target_type:545},{query:"Toronto, Ontario, Kanada",interpretation:{term:[{start:0,end:7,feature_type:"",matched:1,target:1,term_start:0,term_end:4},{start:9,end:16,feature_type:""},{start:18,end:24,feature_type:""}]},operation:2,target_type:37},{query:"Tennessee, USA",interpretation:{term:[{start:0,end:9,feature_type:"",matched:1,target:1,term_start:0,term_end:4},{start:11,end:14,feature_type:""}]},operation:2,target_type:545},{query:"Turin, Italien",interpretation:{term:[{start:0,end:5,feature_type:"",matched:1,target:1,term_start:0,term_end:4},{start:7,end:14,feature_type:""}]},operation:2,target_type:37},{query:"Tampa, Florida, USA",interpretation:{term:[{start:0,end:5,feature_type:"",matched:1,target:1,term_start:0,term_end:4},{start:7,end:14,feature_type:""},{start:16,end:19,feature_type:""}]},operation:2,target_type:37},{query:"Toulouse, Frankreich",interpretation:{term:[{start:0,end:8,feature_type:"",matched:1,target:1,term_start:0,term_end:4},{start:10,end:20,feature_type:""}]},operation:2,target_type:37},{query:"Tucson, Arizona, USA",interpretation:{term:[{start:0,end:6,feature_type:"",matched:1,target:1,term_start:0,term_end:4},{start:8,end:15,feature_type:""},{start:17,end:20,feature_type:""}]},operation:2,target_type:37},{query:"Tokio, Japan",interpretation:{term:[{start:0,end:5,feature_type:"",matched:1,target:1,term_start:0,term_end:4},{start:7,end:12,feature_type:""}]},operation:2,details:[{value:"日本東京都",interpretation:{term:[{start:0,end:2,feature_type:""},{start:2,end:5,feature_type:"",matched:1,target:1,term_start:0,term_end:4}]}}],target_type:8724},{query:"Teneriffa, Spanien",interpretation:{term:[{start:0,end:9,feature_type:"",matched:1,target:1,term_start:0,term_end:4},{start:11,end:18,feature_type:""}]},operation:2,target_type:2626},{query:"Thailand",interpretation:{term:[{start:0,end:8,feature_type:"",matched:1,target:1,term_start:0,term_end:4}]},operation:2,target_type:33}]});
var b = eval([,,,[["Texas, USA",[[[0,5,,,1,,,,1,0,4],[7,10]]],2,,,,,,,,,,,,,,545],["Toronto, Ontario, Kanada",[[[0,7,,,1,,,,1,0,4],[9,16],[18,24]]],2,,,,,,,,,,,,,,37],["Tennessee, USA",[[[0,9,,,1,,,,1,0,4],[11,14]]],2,,,,,,,,,,,,,,545],["Turin, Italien",[[[0,5,,,1,,,,1,0,4],[7,14]]],2,,,,,,,,,,,,,,37],["Tampa, Florida, USA",[[[0,5,,,1,,,,1,0,4],[7,14],[16,19]]],2,,,,,,,,,,,,,,37],["Toulouse, Frankreich",[[[0,8,,,1,,,,1,0,4],[10,20]]],2,,,,,,,,,,,,,,37],["Tucson, Arizona, USA",[[[0,6,,,1,,,,1,0,4],[8,15],[17,20]]],2,,,,,,,,,,,,,,37],["Tokio, Japan",[[[0,5,,,1,,,,1,0,4],[7,12]]],2,,,,,,,[["日本東京都",,,[[[0,2],[2,5,,,1,,,,1,0,4]]]]],,,,,,,8724],["Teneriffa, Spanien",[[[0,9,,,1,,,,1,0,4],[11,18]]],2,,,,,,,,,,,,,,2626],["Thailand",[[[0,8,,,1,,,,1,0,4]]],2,,,,,,,,,,,,,,33]]]);