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 trialEric Negr贸n
4,442 PointsGoogle Maps addListener Code Challenge Trouble
In the Code Challenge for adding info windows to Google Maps I consistently get an error message telling me I need to add exactly what I have already added to the app.js file.
The question asks: "On the next line, in app.js, use "google.maps.event.addListener()" with "marker" as the first argument, "click" as the second, and then an anonymous function as the third."
According to the the topic video and the Google API docs the first argument is an object, the second argument is a string, and the third argument is an anonymous function. I have formatted my answer as:
google.maps.event.addListener(marker, "click", function () {});
When I get the error message it is telling me I need to call what I've just called. I've tried just about everything, including creating the marker object which isn't in the file (all that does is tell me that the first objective is no longer working). What am I missing?
Eric Negr贸n
4,442 PointsEric Negr贸n
4,442 PointsI figured it out. The directions as you to place the code on the wrong line. The marker object is created on line 24.