Weather

FREE
By fyhao | Updated il y a 23 jours | Data
Popularity

0.1 / 10

Latency

23ms

Service Level

0%

Health Check

N/A

Back to All Discussions

how to access values in the response?

Rapid account: Tomjohnson 1492
tomjohnson1492
il y a 9 ans

Can you provide more guidance on accessing values in the response for the weatherdata endpoint? Using this tutorial code, http://docs.mashape.com/javascript, I want to replace data.source with something like data.query.results.channel.description to print the description to the page. However, each time I try this, I get an error msg that says โ€œUncaught TypeError: Cannot read property โ€˜resultsโ€™ of undefinedโ€.

What is the proper dot notation to access some of the values in the response?

Rapid account: Tomjohnson 1492
tomjohnson1492 Commented il y a 9 ans

Figured it out. There was a typo in the code sample. datatype should have been dataType. This was causing the response to be passed as text instead of JSON.

Join in the discussion - add comment below:

Login / Signup to post new comments