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
Neil Bradley
14,402 PointsAdding Info Windows
Currently stuck on Task 2, it 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."
I have added;
google.maps.event.addListener(marker, "click", function(){});
But it keeps saying "You need to call 'google.maps.event.addListener()' with 'marker', 'click' and an anonymous function." :/
5 Answers
Eric Pan
13,398 PointsI just passed the whole code challenge and came back here to help.
Make sure you did step 1/3 on line 27, not 17 as I did. Then the code you listed here should be on line 28, not line 18.
That was my problem. Hope it helps.
Ian Lunn
4,558 PointsTry "marker" with quotes:
google.maps.event.addListener("marker", "click", function(){});
Neil Bradley
14,402 PointsThanks Ian, sadly that did not work. According to the code from the video, it should be;
google.maps.event.addListener(marker, "click", function(){
});
Eric Pan
13,398 PointsI'm stuck here too. Any luck?
Michael Aguilera
19,379 Pointsmake sure you are on line 27 and not line 17, it killed me for a while;) Otherwise the code looks good.