Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript AJAX Basics (retiring) AJAX and APIs Making the AJAX Request

Why is this not passing task 2 the code challenge for the Open Weather Map API?

The question is this: To use the Open Weather Map API, you need to specify a city name or state and state or country. Add a property to the data object. The name of the property should be "q" and the value should be a string with the name of a city, followed by a comma, and a state or country name. For example: q : "Portland, OR". I am not sure what they are looking for. Any help on this would be greatly appreciated. Here is my code:

$(document).ready(function(){
  var weatherAPI = 'http://api.openweathermap.org/data/2.5/weather';
var data = {
  q : "Portland, OR",
    };
};

1 Answer

Simon Coates
Simon Coates
28,694 Points

are you missing a ) ?

$(document).ready(function(){
    var weatherAPI = 'http://api.openweathermap.org/data/2.5/weather';
    var data = {
        q : "Portland, OR",
    };
});

That was it. Thank you for your help.