Would like to use the return of: http://maps.google.de/maps/suggest?q=ham&cp=1&hl=de&gl=de&v=2&json=b as a JSON object in a firefox extension. I tried to parse it using JSON.parse and it didn’t work.
Is there another way instead of using regex to use it as a JSON object?
var xhr_return = JSON.parse(rtoparse);
returns: SyntaxError: JSON.parse
other json files in my script work without problems.
The URL you’re using is not part of google’s official maps API and therefore subject to change, blockage, etc. . You should really use the official API. That being said, despite the URL containing
json, the result is YAML, not JSON. Set the JSON parameter toa(instead ofb) to get a JSON result.