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
Joe Shiels
19,933 PointsCode Challenge: Adding Info Windows
The code challenge says: "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.". Here is my code so far:
var infoWindow = new google.maps.InfoWindow({content: "Magic Kingdom"});
google.maps.event.addListener(marker,"click",function(){});
It says I am not calling the google.maps.event.addListener What am I doing wrong?
6 Answers
Michael Aguilera
19,379 PointsYup, line 27 not 17.
Josep Oriol Soler Català
2,838 PointsTry with a space between parameters, like this:
google.maps.event.addListener(marker, "click", function(){});
babavali s
Courses Plus Student 10,238 Pointsstuck here !
Bummer! You need to call 'google.maps.event.addListener()' with 'marker', 'click' and an anonymous function.
what is missing here , correct me
google.maps.event.addListener(marker, "click", function(){});
babavali s
Courses Plus Student 10,238 Pointsremoved semicolon worked fine.
Anne Liang- MESH net
4,990 Pointsvar infoWindow=new google.maps.InfoWindow({content:"Magic Kingdom"}) google.maps.event.addListener(marker, "click", function(){ });
What did I do wrong here? Can anyone help?
Anne Liang- MESH net
4,990 PointsNever mind. I found out that I was setting it on the wrong place