简体   繁体   English

如何使用Jquery定位特定的JSON输出?

[英]How to target specific JSON output using Jquery?

In the linked jsfiddle I am trying to output a certain result from the JSON. 在链接的jsfiddle中,我试图从JSON输出某个结果。 I assume the issue is the line 我认为问题就在于此

var address = data[results][0][address_components][1][long_name];

but through trial and error I am still unable to target the desired data. 但通过反复试验,我仍然无法定位所需的数据。

http://jsfiddle.net/JzMuy/ http://jsfiddle.net/JzMuy/

Many thanks 非常感谢

Actually the problem is that you cannot preform a Cross Site access request. 实际上问题是您无法执行跨站点访问请求。 You either have to do it with server side code or utilize the JSONP api (if it provides it) 您必须使用服务器端代码或使用JSONP api(如果它提供)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM