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 trialBrian Pelowski
7,202 PointsGoogle Maps - Java Script
I can't get this to question. Alter the app.js on line 28 to select the addresses from the parent window
Here is my code:
$("address").each(function(parent.window){
var $address = $(this);
geocoder.geocode({address: $address.text()}, function(results, status){
if(status == google.maps.GeocoderStatus.OK) addMarkerToMap(results[0].geometry.location, $address.html());
});
4 Answers
James Lister
6,569 PointsHi, I figured this out. $("address", parent.window.document).each(function()
So you need to put it after "address" seperated by a comma
James Lister
6,569 PointsI am stuck here too, It does say to pass in "parent.window.document" but not sure how
Brian Pelowski
7,202 PointsInteresting. I was not sure where to pass it in either.i will try what you did, but an explanation would be nice.
Tony Pollard
5,117 PointsHi, James is correct, however the code you have written is missing { from the end. I was stuck here too and your code above helped greatly but without { it won't accept it. So taking line 28 and replacing it with
$("address", parent.window.document).each(function(){
works perfectly.