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
Mohab Habib
6,389 PointsFixing Info Windows and Google Maps (Code Challenge) [RESOLVED]
Hi guys,
I'm stuck on the first part of this code challenge:
http://teamtreehouse.com/library/fixing-info-windows-and-google-maps
where I need to replace a "div" with an "iframe"
"On line 17, replace the div of id "map" with an iframe with the id of "map", src of "map.html" and seamless attribute set to "seamless"
This is one of the codes I've tried (replacing div with script, as when I replaced div with iframe it returned an error code of "null"):
'<script>
$("#locations").prepend('<iframe id="map" src="map.html" attr="seamless"></iframe>')
</script>'
I keep getting the following error message: "Bummer! The iframe with the id of 'map' is missing"
Thanks in advance for any help, as I feel I'm far off with this answer.
4 Answers
Mohab Habib
6,389 PointsChristopher Leong and Patrick Brown:
Here's the working code:
http://codepen.io/anon/pen/pBrvH
(located under "HTML")
Shannon Yeh
8,987 Pointsseamless=seamless solved the trick. also remove $(#locations) =D
Mohab Habib
6,389 PointsStill not working :\
I tried these codes:
<script> .prepend('<iframe id="map" src="map.html" attr="seamless"></iframe>') </script>
*Update: code doesn't seem to display on the reply thread :S.... I tried what you told me to do (changing seamless and removing #location). and
<script> <iframe id="map" src="map.html" attr="seamless"></iframe> </script>
But I'm still getting the same error message: "Bummer! The iframe with the id of 'map' is missing"
Mohab Habib
6,389 PointsFinally fixed it! Thanks a lot for your tip, finally got around it :D
Patrick Brown
7,995 PointsCan you share what you did to get it to work? I've tried more than few different things and I'm still erroring out.
Christopher Leong
7,678 Points<iframe id="map" src="map.html" seamless="seamless"></iframe> works..
Christopher Leong
7,678 PointsHabib can u share? I can't get it to work too..
Qian Wu
11,749 Points<iframe id="map" src="map.html" seamless=seamless></iframe> replace <div> tag
Christopher Leong
7,678 PointsChristopher Leong
7,678 PointsThanks alot ... ! I wrote the exact code previously but I didn't mange to get it working..