0

In the linked jsfiddle I am trying to output a certain result from the 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/

Many thanks

1
  • (1) You have a same-origin violation: "XMLHttpRequest cannot load http://maps.googleapis.com/maps/api/geocode/json?latlng=54.9882,-1.5747&sensor=false. Origin http://fiddle.jshell.net is not allowed by Access-Control-Allow-Origin." (2) results, address_components, and long_name are treated as undefined variables. Commented May 12, 2012 at 18:18

1 Answer 1

2

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)

Sign up to request clarification or add additional context in comments.

2 Comments

assuming I can't use PHP or any other server side language how would I go about extacting this data? Thanks
Here a question that should answer that stackoverflow.com/questions/2921745/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.