Skip to content
Advertisement

Javascript access repsonse of API

I am somehow stuck. Probably this is an easy question, but I just can’t get it working.

I am trying to access a response from an API (mapquest), but I can not find a way to dig into the reponse to extract the relevant information. Here is my console-log and my code, I actually want to access the responseJSON and some stuff in there (results).

JavaScript

results

I found this stringify stuff on SO; but nothing worked as I expected, so probably there is a basic problem here.

Advertisement

Answer

You can access ur data with .done method. More information in official documentation jQuery Ajax

JavaScript

Done method is called when async call is done.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement